Commit ea47e05f authored by anozdrin/alik@booka.'s avatar anozdrin/alik@booka.
Browse files

Fix for BUG##24415: Instance manager test im_daemon_life_cycle

fails randomly.

The problem was that the test case used command line tool (mysql)
without specifying connect_timeout argument. In some cases,
this lead to hanging of the test case.

The fix is to specify --connect_timeout=1 when starting mysql.

Also, the patch contains polishing and various cleanups to simplify
analyzing of the problems further.

The patch affects only test suite, no server codebase has been
touched.
parent 3b9a8532
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -582,7 +582,7 @@ sub mtr_im_start($$) {
    mtr_add_arg($args, $opt);
  }

  $im->{'pid'} =
  $im->{'spawner_pid'} =
    mtr_spawn(
      $::exe_im,                        # path to the executable
      $args,                            # cmd-line args
@@ -593,7 +593,7 @@ sub mtr_im_start($$) {
      { append_log_file => 1 }          # append log files
      );

  unless ( $im->{'pid'} )
  unless ( $im->{'spawner_pid'} )
  {
    mtr_error('Could not start Instance Manager.')
  }
+1 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ sub mtr_get_pid_from_file ($) {

    # Read pid number from file
    my $pid= <FILE>;
    chomp $pid;
    close FILE;

    return $pid if $pid=~ /^(\d+)/;
+6 −0
Original line number Diff line number Diff line
@@ -937,6 +937,12 @@ sub check_expected_crash_and_restart($)
      }
    }
  }

  if ($::instance_manager->{'spawner_pid'} eq $ret_pid)
  {
    return;
  }

  mtr_warning("check_expected_crash_and_restart couldn't find an entry for pid: $ret_pid");

}
+2 −2
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ instance_name status
mysqld1	online
mysqld2	offline
Killing the process...
Sleeping...
Waiting...
Success: the process was restarted.
Success: server is ready to accept connection on socket.

@@ -16,7 +16,7 @@ Success: server is ready to accept connection on socket.
START INSTANCE mysqld2;
Success: the process has been started.
Killing the process...
Sleeping...
Waiting...
Success: the process was restarted.
Success: server is ready to accept connection on socket.
SHOW INSTANCE STATUS mysqld1;
+2 −2
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ ERROR HY000: Bad instance name. Check that the instance with such a name exists
-- 1.1.6.
--------------------------------------------------------------------
Killing the process...
Sleeping...
Waiting...
Success: the process was restarted.
SHOW INSTANCES;
instance_name	status
@@ -52,7 +52,7 @@ mysqld2 offline
START INSTANCE mysqld2;
Success: the process has been started.
Killing the process...
Sleeping...
Waiting...
Success: the process was killed.

--------------------------------------------------------------------
Loading