Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit e5532f1

Browse files
committed
Fix failures with TAP tests of pg_ctl on Windows
On Windows, all the hosts spawned by the TAP tests bind to 127.0.0.1. Hence, if there is a port conflict, starting a cluster would immediately fail. One of the test scripts of pg_ctl initializes a node without PostgresNode.pm, using the default port 5432. This could cause unexpected startup failures in the tests if an independent server was up and running on the same host (the reverse is also possible, though more unlikely). Fix this issue by assigning properly a free port to the node configured, in the same range used as for the other nodes part of the tests. Author: Michael Paquier Reviewed-by: Andrew Dunstan Discussion: https://postgr.es/m/20191202031444.GC1696@paquier.xyz Backpatch-through: 11
1 parent 55a1954 commit e5532f1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/bin/pg_ctl/t/001_start_stop.pl

+2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@
2222
'pg_ctl initdb');
2323
command_ok([ $ENV{PG_REGRESS}, '--config-auth', "$tempdir/data" ],
2424
'configure authentication');
25+
my $node_port = get_free_port();
2526
open my $conf, '>>', "$tempdir/data/postgresql.conf";
2627
print $conf "fsync = off\n";
28+
print $conf "port = $node_port\n";
2729
print $conf TestLib::slurp_file($ENV{TEMP_CONFIG})
2830
if defined $ENV{TEMP_CONFIG};
2931

0 commit comments

Comments
 (0)