Skip Menu |

This queue is for tickets about the DBD-Pg CPAN distribution.

Report information
The Basics
Id: 132965
Status: resolved
Priority: 0/
Queue: DBD-Pg

People
Owner: greg [...] turnstep.com
Requestors: KENTNL [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 3.14.0



Subject: Tests no longer pass when DBI_USER != postgres
In the past, it was completely fine to inject this in your environment before running tests:

DBI_DSN="dbi:Pg:dbname=pgtest"
DBI_USER="pgtest_user"
DBI_PASS="test"

( See also: https://wiki.gentoo.org/wiki/Project:Perl/maint-notes/dev-perl/DBD-Pg#Portage_Configuration )

And the database configuration is done as following:

 https://wiki.gentoo.org/wiki/Project:Perl/maint-notes/dev-perl/DBD-Pg#Database_Configuration

Which to me, seemed nicer and provided more guarantees about not contaminating your database than the default, "run tests as superuser: postgres"

Alas, this now seems to mean that various tests are broken, because they *ONLY* work as the superuser.

t/03dbmethod.t ......... 1/600 DBD::Pg::db do failed: ERROR:  permission denied to create foreign-data wrapper "dbd_pg_testfdw"
HINT:  Must be superuser to create a foreign-data wrapper. at t/03dbmethod.t line 742.
Issuing rollback() due to DESTROY without explicit disconnect() of DBD::Pg::db handle dbname=pgtest at t/03dbmethod.t line 742.
Show quoted text
# Looks like your test exited with 255 just after 134.
t/03dbmethod.t ......... Dubious, test returned 255 (wstat 65280, 0xff00)


t/04misc.t ............. 81/95 DBD::Pg::db do failed: ERROR:  permission denied to set parameter "max_stack_depth" at t/04misc.t line 532, <$fh> line 8.
Issuing rollback() due to DESTROY without explicit disconnect() of DBD::Pg::db handle dbname=pgtest at t/04misc.t line 532, <$fh> line 8.
Show quoted text
# Looks like your test exited with 255 just after 81.
t/04misc.t ............. Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 14/95 subtests


This was, for whatever reason, previously not the case.


Show quoted text
# DBI                         Version 1.637
# DBD::Pg                     Version 3.13.0
# Perl                        Version 5.30.3
# OS                          linux
# PostgreSQL (compiled)       120003
# PostgreSQL (target)         120003
# PostgreSQL (reported)       PostgreSQL 12.3 on x86_64-pc-linux-gnu, compiled by x86_64-pc-linux-gnu-gcc (Gentoo 10.1.0 p1) 10.1.0, 64-bit
# Default port                5432
# DBI_DSN                     dbi:Pg:db="pgtest"
# DBI_USER                    pgtest_user
# Test schema                 dbd_pg_testschema
# LANG                        en_NZ.UTF8
# DBDPG_TEST_ALWAYS_ENV       1

Full test report comming to a CPAN Testers near you eventually when it stops timing out on every page load.

-- 
- CPAN kentnl@cpan.org
- Gentoo Perl Maintainer kentnl@gentoo.org ( perl@gentoo.org )
Thanks for the report. We've been heavily testing the full-initdb-and-test strategy, but will make sure that using existing databases and non superusers works again too!