Skip to content

Commit 6f55b4f

Browse files
committed
Make sure to run pg_isready on correct port
The current code can have pg_isready unexpectedly succeed if there is a server running on the default port. To avoid this we delay running the test until after a node has been created but before it starts, and then use that node's port, so we are fairly sure there is nothing running on the port. Backpatch to all live branches.
1 parent 5546a83 commit 6f55b4f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/bin/scripts/t/080_pg_isready.pl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212
program_version_ok('pg_isready');
1313
program_options_handling_ok('pg_isready');
1414

15-
command_fails(['pg_isready'], 'fails with no server running');
16-
1715
my $node = PostgreSQL::Test::Cluster->new('main');
1816
$node->init;
17+
18+
$node->command_fails(['pg_isready'], 'fails with no server running');
19+
1920
$node->start;
2021

2122
$node->command_ok(

0 commit comments

Comments
 (0)