Subject: | Breaks with long temp dir path |
I am attaching a test that is slightly modified from your synopsis.
This test sets $ENV{TMPDIR} to a very long directory name. I get the following errors:
!prove -Ilib -v xxx.t
xxx.t ..
1..0 # SKIP Failed to start postgres on port 15442: Failed to open /tmp/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/pgtest.bfrXe/data/postmaster.pid: No such file or directory at /home/exodist/perl5/perlbrew/perls/main/lib/site_perl/5.30.0/Test/PostgreSQL.pm line 429.
skipped: Failed to start postgres on port 15442: Failed to open /tmp/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/pgtest.bfrXe/data/postmaster.pid: No such file or directory at /home/exodist/perl5/perlbrew/perls/main/lib/site_perl/5.30.0/Test/PostgreSQL.pm line 429.
Files=1, Tests=0, 1 wallclock secs ( 0.01 usr 0.00 sys + 0.70 cusr 0.24 csys = 0.95 CPU)
Result: NOTESTS
Note that the errors do not occur if I set a short custom directory name. I will also note that it is not the length of any section of the dir, I can do /tmp/foo/bar/baz/.... and once it gets long enough the errors happen.
This is mainly a problem in yath (Test2::Harness) which gives all running tests their own temp directories to avoid cross-contamination. It does not always happen, current version of yath on cpan does not produce long enough temp dirs to be a problem, but an update coming soon does.
Under yath there is additional debugging output:
( STDERR ) job 1 pg_ctl: could not start server
( STDERR ) job 1 Examine the log output.
( STDERR ) job 1 pg_ctl: could not start server
( STDERR ) job 1 Examine the log output.
( STDERR ) job 1 pg_ctl: could not start server
( STDERR ) job 1 Examine the log output.
( STDERR ) job 1 pg_ctl: could not start server
( STDERR ) job 1 Examine the log output.
( STDERR ) job 1 pg_ctl: could not start server
( STDERR ) job 1 Examine the log output.
( STDERR ) job 1 pg_ctl: could not start server
( STDERR ) job 1 Examine the log output.
( STDERR ) job 1 pg_ctl: could not start server
( STDERR ) job 1 Examine the log output.
( STDERR ) job 1 pg_ctl: could not start server
( STDERR ) job 1 Examine the log output.
( STDERR ) job 1 pg_ctl: could not start server
( STDERR ) job 1 Examine the log output.
( STDERR ) job 1 pg_ctl: could not start server
( STDERR ) job 1 Examine the log output.
( STDERR ) job 1 pg_ctl: could not start server
( STDERR ) job 1 Examine the log output.
I am not sure if this is a limitation in Test:PostgreSQL, or in postgres itself.
Subject: | xxx.t |
BEGIN {
my $dir = "/tmp/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
$ENV{TMPDIR} = $dir;
}
use DBI;
use Test::PostgreSQL;
use Test::More;
my $pgsql = eval { Test::PostgreSQL->new() }
or plan skip_all => $@;
my $dbh = DBI->connect($pgsql->dsn);
ok(1);
done_testing;