~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to mysql-test/lib/mtr_process.pl

manual merge 6.0-main --> 6.0-bka-review

Show diffs side-by-side

added added

removed removed

Lines of Context:
474
474
          }
475
475
        }
476
476
      }
477
 
      else
478
 
      {
479
 
        mtr_warning("Found non pid file $elem in $rundir")
480
 
          if -f "$rundir/$elem";
481
 
        next;
482
 
      }
483
477
    }
484
478
    closedir(RUNDIR);
485
479
 
886
880
      mtr_verbose("$mysqld->{'type'} $mysqld->{'idx'} exited, pid: $ret_pid");
887
881
      $mysqld->{'pid'}= 0;
888
882
 
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 )
 
886
      while ( 1 )
893
887
      {
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 )
 
889
        {
 
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/ )
 
899
          {
 
900
            mtr_verbose("Test asks that we wait before restart");
 
901
            # Millisceond sleep emulated with select
 
902
            select(undef, undef, undef, (0.1));
 
903
            next;
 
904
          }
 
905
          unlink($expect_file);
 
906
          mysqld_start($mysqld, $mysqld->{'start_opts'},
 
907
                       $mysqld->{'start_slave_master_info'});
 
908
        }
 
909
        last;
898
910
      }
899
911
 
900
912
      return;
914
926
      if ( -f $expect_file )
915
927
      {
916
928
        mtr_verbose("Crash was expected, file $expect_file exists");
 
929
        unlink($expect_file);
917
930
        ndbmgmd_start($cluster);
918
 
        unlink($expect_file);
919
931
      }
920
932
      return;
921
933
    }
933
945
        if ( -f $expect_file )
934
946
        {
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);
939
951
        }
940
952
        return;
941
953
      }