diff options
author | Greg Sabino Mullane | 2009-06-12 21:35:15 +0000 |
---|---|---|
committer | Greg Sabino Mullane | 2009-06-12 21:35:15 +0000 |
commit | 54d7c17e8360d460c32c68cb552acc86f15d8045 (patch) | |
tree | f319830256ab0c3fa87bb2efc0ffd2f049d75f08 /t/CP_Testing.pm | |
parent | 05abcfd8c242baced7fc65866284f07c833c771e (diff) |
Shut down all of our test databases, make room for future of five at once (!)
Diffstat (limited to 't/CP_Testing.pm')
-rw-r--r-- | t/CP_Testing.pm | 24 |
1 files changed, 14 insertions, 10 deletions
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 { |