summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--t/99_cleanup.t2
-rw-r--r--t/CP_Testing.pm24
2 files changed, 15 insertions, 11 deletions
diff --git a/t/99_cleanup.t b/t/99_cleanup.t
index c86274f97..54bb707e3 100644
--- a/t/99_cleanup.t
+++ b/t/99_cleanup.t
@@ -16,6 +16,6 @@ my $cp = CP_Testing->new();
$cp->cleanup();
-pass 'Test database has been shut down';
+pass 'Test database(s) shut down';
exit;
diff --git a/t/CP_Testing.pm b/t/CP_Testing.pm
index b4672287a..5638cb1d1 100644
--- a/t/CP_Testing.pm
+++ b/t/CP_Testing.pm
@@ -36,18 +36,22 @@ sub cleanup {
my $self = shift;
my $dbdir = $self->{dbdir} or die;
- my $pidfile = "$dbdir/data space/postmaster.pid";
- return if ! -e $pidfile;
- open my $fh, '<', $pidfile or die qq{Could not open "$pidfile": $!\n};
- <$fh> =~ /^(\d+)/ or die qq{File "$pidfile" did not start with a number!\n};
- my $pid = $1;
- close $fh or die qq{Could not close "$pidfile": $!\n};
- kill 15 => $pid;
- sleep 1;
- if (kill 0 => $pid) {
- kill 9 => $pid;
+ for my $dirnum ('', '2', '3', '4', '5') {
+ my $pidfile = "$dbdir$dirnum/data space/postmaster.pid";
+ next if ! -e $pidfile;
+ open my $fh, '<', $pidfile or die qq{Could not open "$pidfile": $!\n};
+ <$fh> =~ /^(\d+)/ or die qq{File "$pidfile" did not start with a number!\n};
+ my $pid = $1;
+ close $fh or die qq{Could not close "$pidfile": $!\n};
+ kill 15 => $pid;
+ sleep 1;
+ if (kill 0 => $pid) {
+ kill 9 => $pid;
+ }
}
+
return;
+
}
sub test_database_handle {