summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-08-31 13:45:49 +0200
committerSergei Golubchik <serg@mariadb.org>2018-09-04 09:19:49 +0200
commitc27275474040ba7f91868dcb1ab79306418268d2 (patch)
tree413d2e9f98da156e9e0dd2cb6de1e1236a545780
parent1d98255f613af130bae428e80b95712a2048acc1 (diff)
downloadmariadb-git-c27275474040ba7f91868dcb1ab79306418268d2.tar.gz
MDEV-15792 Fix mtr to be able to wait for >1 exited mysqld
Post-merge fixes: minor perlification and get rid of an annoying run-time warning (undef value in string comparison) Closes #709
-rwxr-xr-xmysql-test/mysql-test-run.pl16
1 files changed, 6 insertions, 10 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 4801cb77a4c..0d84e5dbbbc 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -3986,8 +3986,8 @@ sub run_testcase ($$) {
while (1)
{
- my $proc = 0;
- if (scalar(keys(%keep_waiting_proc)) > 0)
+ my $proc;
+ if (%keep_waiting_proc)
{
# Any other process exited?
$proc = My::SafeProcess->check_any();
@@ -4004,7 +4004,7 @@ sub run_testcase ($$) {
}
}
}
- if (scalar(keys(%keep_waiting_proc)) == 0 && !$proc)
+ if (!%keep_waiting_proc && !$proc)
{
if ($test_timeout > $print_timeout)
{
@@ -4024,7 +4024,7 @@ sub run_testcase ($$) {
}
}
- if ($proc eq $test) # mysqltest itself exited
+ if ($proc and $proc eq $test) # mysqltest itself exited
{
my $res= $test->exit_status();
@@ -4138,7 +4138,6 @@ sub run_testcase ($$) {
mtr_verbose("Got " . join(",", keys(%keep_waiting_proc)));
mark_time_used('test');
- my $expected_exit = 1;
foreach my $wait_for_proc (keys(%keep_waiting_proc)) {
# ----------------------------------------------------
# Check if it was an expected crash
@@ -4146,8 +4145,7 @@ sub run_testcase ($$) {
my $check_crash = check_expected_crash_and_restart($wait_for_proc);
if ($check_crash == 0) # unexpected exit/crash of $wait_for_proc
{
- $expected_exit = 0;
- last;
+ goto SRVDIED;
}
elsif ($check_crash == 1) # $wait_for_proc was started again by check_expected_crash_and_restart()
{
@@ -4159,9 +4157,7 @@ sub run_testcase ($$) {
}
}
- if ($expected_exit) {
- next;
- }
+ next;
SRVDIED:
# ----------------------------------------------------