Don't try to shutdown servers that have not been started in regression tests.

This avoids spurious output from failing shutdowns and uninitialized
variable warnings if pg_regress_multi.pl fails before starting servers.
pull/917/head
Andres Freund 2016-10-26 06:51:16 -07:00
parent 03c06a3b68
commit c3e1d49e34
1 changed files with 5 additions and 1 deletions

View File

@ -47,6 +47,8 @@ my %fdwServers = ();
my %functions = (); my %functions = ();
my %operators = (); my %operators = ();
my $serversAreShutdown = "TRUE";
GetOptions( GetOptions(
'bindir=s' => \$bindir, 'bindir=s' => \$bindir,
'libdir=s' => \$libdir, 'libdir=s' => \$libdir,
@ -170,7 +172,6 @@ for my $port (@workerPorts)
} }
# Routine to shutdown servers at failure/exit # Routine to shutdown servers at failure/exit
my $serversAreShutdown = "FALSE";
sub ShutdownServers() sub ShutdownServers()
{ {
if ($serversAreShutdown eq "FALSE") if ($serversAreShutdown eq "FALSE")
@ -204,6 +205,9 @@ END
} }
} }
# Signal that servers should be shutdown
$serversAreShutdown = "FALSE";
# Start servers # Start servers
system("$bindir/pg_ctl", system("$bindir/pg_ctl",
('start', '-w', ('start', '-w',