Skip to content

Commit

Permalink
MDEV-15792 Fix mtr to be able to wait for >1 exited mysqld
Browse files Browse the repository at this point in the history
Post-merge fixes: minor perlification and get rid of an
annoying run-time warning (undef value in string comparison)

Closes #709
  • Loading branch information
vuvova committed Sep 4, 2018
1 parent 1d98255 commit c272754
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions mysql-test/mysql-test-run.pl
Expand Up @@ -3986,8 +3986,8 @@ ($$)

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();
Expand All @@ -4004,7 +4004,7 @@ ($$)
}
}
}
if (scalar(keys(%keep_waiting_proc)) == 0 && !$proc)
if (!%keep_waiting_proc && !$proc)
{
if ($test_timeout > $print_timeout)
{
Expand All @@ -4024,7 +4024,7 @@ ($$)
}
}

if ($proc eq $test) # mysqltest itself exited
if ($proc and $proc eq $test) # mysqltest itself exited
{
my $res= $test->exit_status();

Expand Down Expand Up @@ -4138,16 +4138,14 @@ ($$)
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
# ----------------------------------------------------
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()
{
Expand All @@ -4159,9 +4157,7 @@ ($$)
}
}

if ($expected_exit) {
next;
}
next;

SRVDIED:
# ----------------------------------------------------
Expand Down

0 comments on commit c272754

Please sign in to comment.