886
880
mtr_verbose("$mysqld->{'type'} $mysqld->{'idx'} exited, pid: $ret_pid");
887
881
$mysqld->{'pid'}= 0;
889
# Check if crash expected and restart if it was
883
# Check if crash expected, and restart if it was
890
884
my $expect_file= "$::opt_vardir/tmp/" . "$mysqld->{'type'}" .
891
885
"$mysqld->{'idx'}" . ".expect";
892
if ( -f $expect_file )
894
mtr_verbose("Crash was expected, file $expect_file exists");
895
mysqld_start($mysqld, $mysqld->{'start_opts'},
896
$mysqld->{'start_slave_master_info'});
897
unlink($expect_file);
888
if ( -f $expect_file )
890
mtr_verbose("Crash was expected, file $expect_file exists");
891
my $expect_file_handler;
892
open($expect_file_handler, "<$expect_file") or die;
893
my @expect_lines= <$expect_file_handler>;
894
close $expect_file_handler;
895
# look at most recent order by the test
896
my $expect_content= pop @expect_lines;
897
chomp $expect_content;
898
if ( $expect_content =~ /^wait/ )
900
mtr_verbose("Test asks that we wait before restart");
901
# Millisceond sleep emulated with select
902
select(undef, undef, undef, (0.1));
905
unlink($expect_file);
906
mysqld_start($mysqld, $mysqld->{'start_opts'},
907
$mysqld->{'start_slave_master_info'});
933
945
if ( -f $expect_file )
935
947
mtr_verbose("Crash was expected, file $expect_file exists");
948
unlink($expect_file);
936
949
ndbd_start($cluster, $ndbd->{'idx'},
937
950
$ndbd->{'start_extra_args'});
938
unlink($expect_file);