aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2006-11-20 06:22:51 +0000
committerYang Tse <yangsita@gmail.com>2006-11-20 06:22:51 +0000
commitd8387b418db176b952e931c9d54c1c04fd5499c8 (patch)
treeb4ec60bde5b2aea7ecd31a2643a5cf83131881d8 /tests
parentadea16a2944f050d248a145fcadb3d1df263481f (diff)
stop slaves before stopping servers
Diffstat (limited to 'tests')
-rwxr-xr-xtests/runtests.pl32
1 files changed, 20 insertions, 12 deletions
diff --git a/tests/runtests.pl b/tests/runtests.pl
index 688d52b11..1e2e37c7e 100755
--- a/tests/runtests.pl
+++ b/tests/runtests.pl
@@ -436,7 +436,8 @@ sub stoptestserver {
my $pid;
my $pidfile;
my $pidfiles = "";
- my $pidsrunning = "";
+ my $slavepids = "";
+ my $serverpids = "";
if($run{$serv}) {
if($run{$serv}{'slavepidfiles'}) {
@@ -444,7 +445,7 @@ sub stoptestserver {
$pidfiles .= " $pidfile";
$pid = checkalivepidfile($pidfile);
if($pid > 0) {
- $pidsrunning .= " $pid";
+ $slavepids .= " $pid";
}
}
delete $run{$serv}{'slavepidfiles'};
@@ -454,21 +455,24 @@ sub stoptestserver {
$pidfiles .= " $pidfile";
$pid = checkalivepidfile($pidfile);
if($pid > 0) {
- $pidsrunning .= " $pid";
+ $serverpids .= " $pid";
}
delete $run{$serv}{'pidfile'};
}
if($run{$serv}{'pids'}) {
$pid = $run{$serv}{'pids'};
- $pidsrunning .= " $pid";
+ $serverpids .= " $pid";
delete $run{$serv}{'pids'};
}
if($run{$serv}) {
delete $run{$serv};
}
}
- if($pidsrunning) {
- $ret = stopprocess($pidsrunning);
+ if($slavepids) {
+ $ret = stopprocess($slavepids);
+ }
+ if($serverpids) {
+ $ret = stopprocess($serverpids);
}
if($pidfiles) {
unlinkpidfiles($pidfiles);
@@ -1840,7 +1844,8 @@ sub stopalltestservers {
my $pid;
my $pidfile;
my $pidfiles = "";
- my $pidsrunning = "";
+ my $slavepids = "";
+ my $serverpids = "";
for my $serv (keys %run) {
if($run{$serv}) {
@@ -1849,7 +1854,7 @@ sub stopalltestservers {
$pidfiles .= " $pidfile";
$pid = checkalivepidfile($pidfile);
if($pid > 0) {
- $pidsrunning .= " $pid";
+ $slavepids .= " $pid";
}
}
delete $run{$serv}{'slavepidfiles'};
@@ -1859,13 +1864,13 @@ sub stopalltestservers {
$pidfiles .= " $pidfile";
$pid = checkalivepidfile($pidfile);
if($pid > 0) {
- $pidsrunning .= " $pid";
+ $serverpids .= " $pid";
}
delete $run{$serv}{'pidfile'};
}
if($run{$serv}{'pids'}) {
$pid = $run{$serv}{'pids'};
- $pidsrunning .= " $pid";
+ $serverpids .= " $pid";
delete $run{$serv}{'pids'};
}
if($run{$serv}) {
@@ -1873,8 +1878,11 @@ sub stopalltestservers {
}
}
}
- if($pidsrunning) {
- $ret = stopprocess($pidsrunning);
+ if($slavepids) {
+ $ret = stopprocess($slavepids);
+ }
+ if($serverpids) {
+ $ret = stopprocess($serverpids);
}
if($pidfiles) {
unlinkpidfiles($pidfiles);