aboutsummaryrefslogtreecommitdiff
path: root/tests/runtests.pl
diff options
context:
space:
mode:
Diffstat (limited to 'tests/runtests.pl')
-rwxr-xr-xtests/runtests.pl58
1 files changed, 42 insertions, 16 deletions
diff --git a/tests/runtests.pl b/tests/runtests.pl
index 1e2e37c7e..bd4802632 100755
--- a/tests/runtests.pl
+++ b/tests/runtests.pl
@@ -440,6 +440,7 @@ sub stoptestserver {
my $serverpids = "";
if($run{$serv}) {
+ logmsg ("RUN: Stopping the $serv server...\n");
if($run{$serv}{'slavepidfiles'}) {
for $pidfile (split(" ", $run{$serv}{'slavepidfiles'})) {
$pidfiles .= " $pidfile";
@@ -450,29 +451,41 @@ sub stoptestserver {
}
delete $run{$serv}{'slavepidfiles'};
}
+ if($run{$serv}{'pids'}) {
+ $pid = $run{$serv}{'pids'};
+ $serverpids .= " $pid";
+ delete $run{$serv}{'pids'};
+ }
if($run{$serv}{'pidfile'}) {
$pidfile = $run{$serv}{'pidfile'};
$pidfiles .= " $pidfile";
$pid = checkalivepidfile($pidfile);
- if($pid > 0) {
+ if(($pid > 0) && ($serverpids !~ /\b$pid\b/)) {
$serverpids .= " $pid";
}
delete $run{$serv}{'pidfile'};
}
- if($run{$serv}{'pids'}) {
- $pid = $run{$serv}{'pids'};
- $serverpids .= " $pid";
- delete $run{$serv}{'pids'};
- }
if($run{$serv}) {
delete $run{$serv};
}
}
if($slavepids) {
- $ret = stopprocess($slavepids);
+ logmsg ("* slave pid(s) $slavepids\n");
+ }
+ if($serverpids) {
+ logmsg ("* server pid(s) $serverpids\n");
+ }
+ if($slavepids) {
+ $ret = stopprocess($slavepids, 1);
+ if($ret == 0) {
+ logmsg ("* slave process is still alive !!!\n");
+ }
}
if($serverpids) {
- $ret = stopprocess($serverpids);
+ $ret = stopprocess($serverpids, 1);
+ if($ret == 0) {
+ logmsg ("* server process is still alive !!!\n");
+ }
}
if($pidfiles) {
unlinkpidfiles($pidfiles);
@@ -1849,6 +1862,7 @@ sub stopalltestservers {
for my $serv (keys %run) {
if($run{$serv}) {
+ logmsg ("RUN: Stopping the $serv server...\n");
if($run{$serv}{'slavepidfiles'}) {
for $pidfile (split(" ", $run{$serv}{'slavepidfiles'})) {
$pidfiles .= " $pidfile";
@@ -1859,30 +1873,42 @@ sub stopalltestservers {
}
delete $run{$serv}{'slavepidfiles'};
}
+ if($run{$serv}{'pids'}) {
+ $pid = $run{$serv}{'pids'};
+ $serverpids .= " $pid";
+ delete $run{$serv}{'pids'};
+ }
if($run{$serv}{'pidfile'}) {
$pidfile = $run{$serv}{'pidfile'};
$pidfiles .= " $pidfile";
$pid = checkalivepidfile($pidfile);
- if($pid > 0) {
+ if(($pid > 0) && ($serverpids !~ /\b$pid\b/)) {
$serverpids .= " $pid";
}
delete $run{$serv}{'pidfile'};
}
- if($run{$serv}{'pids'}) {
- $pid = $run{$serv}{'pids'};
- $serverpids .= " $pid";
- delete $run{$serv}{'pids'};
- }
if($run{$serv}) {
delete $run{$serv};
}
}
}
if($slavepids) {
- $ret = stopprocess($slavepids);
+ logmsg ("* slave pid(s) $slavepids\n");
+ }
+ if($serverpids) {
+ logmsg ("* server pid(s) $serverpids\n");
+ }
+ if($slavepids) {
+ $ret = stopprocess($slavepids, 1);
+ if($ret == 0) {
+ logmsg ("* slave process is still alive !!!\n");
+ }
}
if($serverpids) {
- $ret = stopprocess($serverpids);
+ $ret = stopprocess($serverpids, 1);
+ if($ret == 0) {
+ logmsg ("* server process is still alive !!!\n");
+ }
}
if($pidfiles) {
unlinkpidfiles($pidfiles);