Commit 80c96d85 authored by unknown's avatar unknown

Merge neptunus.(none):/home/msvensson/mysql/same_tools/my41-same_tools

into  neptunus.(none):/home/msvensson/mysql/same_tools/my50-same_tools


mysql-test/lib/mtr_cases.pl:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
parents 5c8da505 9350dbc4
...@@ -164,31 +164,36 @@ sub collect_test_cases ($) { ...@@ -164,31 +164,36 @@ sub collect_test_cases ($) {
# Make a mapping of test name to a string that represents how that test # Make a mapping of test name to a string that represents how that test
# should be sorted among the other tests. Put the most important criterion # should be sorted among the other tests. Put the most important criterion
# first, then a sub-criterion, then sub-sub-criterion, et c. # first, then a sub-criterion, then sub-sub-criterion, et c.
foreach $tinfo (@$cases) foreach $tinfo (@$cases)
{ {
my @this_criteria = (); my @this_criteria = ();
#
# Append the criteria for sorting, in order of importance. # Append the criteria for sorting, in order of importance.
push(@this_criteria, join("!", sort @{$tinfo->{'master_opt'}}) . "~"); # Ending with "~" makes empty sort later than filled #
push(@this_criteria, "ndb=" . ($tinfo->{'ndb_test'} ? "1" : "0")); push(@this_criteria, "ndb=" . ($tinfo->{'ndb_test'} ? "1" : "0"));
push(@this_criteria, "restart=" . ($tinfo->{'master_restart'} ? "1" : "0")); push(@this_criteria, "restart=" . ($tinfo->{'master_restart'} ? "1" : "0"));
push(@this_criteria, "big_test=" . ($tinfo->{'big_test'} ? "1" : "0")); # Group test with similar options together.
push(@this_criteria, join("|", sort keys %{$tinfo})); # Group similar things together. The values may differ substantially. FIXME? # Ending with "~" makes empty sort later than filled
push(@this_criteria, $tinfo->{'name'}); # Finally, order by the name push(@this_criteria, join("!", sort @{$tinfo->{'master_opt'}}) . "~");
# Finally, order by the name
push(@this_criteria, $tinfo->{'name'});
$sort_criteria{$tinfo->{"name"}} = join(" ", @this_criteria); $sort_criteria{$tinfo->{"name"}} = join(" ", @this_criteria);
} }
@$cases = sort { $sort_criteria{$a->{"name"}} cmp $sort_criteria{$b->{"name"}}; } @$cases; @$cases = sort { $sort_criteria{$a->{"name"}} cmp $sort_criteria{$b->{"name"}}; } @$cases;
### For debugging the sort-order ### For debugging the sort-order
# foreach $tinfo (@$cases) foreach $tinfo (@$cases)
# { {
# print $sort_criteria{$tinfo->{"name"}}; print $sort_criteria{$tinfo->{"name"}};
# print " -> \t"; print " -> \t";
# print $tinfo->{"name"}; print $tinfo->{"name"};
# print "\n"; print "\n";
# } }
} }
return $cases; return $cases;
......
...@@ -323,7 +323,7 @@ our $default_mysqld_port; ...@@ -323,7 +323,7 @@ our $default_mysqld_port;
sub main (); sub main ();
sub initial_setup (); sub initial_setup ();
sub command_line_setup (); sub command_line_setup ();
sub snapshot_setup (); sub datadir_setup ();
sub executable_setup (); sub executable_setup ();
sub environment_setup (); sub environment_setup ();
sub kill_running_server (); sub kill_running_server ();
...@@ -416,7 +416,6 @@ sub main () { ...@@ -416,7 +416,6 @@ sub main () {
unless $need_ndbcluster; unless $need_ndbcluster;
$opt_skip_im= 1 unless $need_im; $opt_skip_im= 1 unless $need_im;
snapshot_setup();
initialize_servers(); initialize_servers();
run_suite($opt_suite, $tests); run_suite($opt_suite, $tests);
...@@ -1122,7 +1121,7 @@ sub command_line_setup () { ...@@ -1122,7 +1121,7 @@ sub command_line_setup () {
$path_snapshot= "$opt_tmpdir/snapshot_$opt_master_myport/"; $path_snapshot= "$opt_tmpdir/snapshot_$opt_master_myport/";
} }
sub snapshot_setup () { sub datadir_setup () {
# Make a list of all data_dirs # Make a list of all data_dirs
@data_dir_lst = ( @data_dir_lst = (
...@@ -2370,6 +2369,9 @@ sub run_suite () { ...@@ -2370,6 +2369,9 @@ sub run_suite () {
############################################################################## ##############################################################################
sub initialize_servers () { sub initialize_servers () {
datadir_setup();
if ( ! $glob_use_running_server ) if ( ! $glob_use_running_server )
{ {
kill_running_server(); kill_running_server();
...@@ -3520,6 +3522,11 @@ sub run_testcase_need_master_restart($) ...@@ -3520,6 +3522,11 @@ sub run_testcase_need_master_restart($)
join(" ", @{$tinfo->{'master_opt'}}) . "' != '" . join(" ", @{$tinfo->{'master_opt'}}) . "' != '" .
join(" ", @{$master->[0]->{'start_opts'}}) . "'" ); join(" ", @{$master->[0]->{'start_opts'}}) . "'" );
} }
elsif( ! $master->[0]->{'pid'} )
{
$do_restart= 1;
mtr_verbose("Restart because: master is not started");
}
return $do_restart; return $do_restart;
} }
...@@ -3531,57 +3538,35 @@ sub run_testcase_need_slave_restart($) ...@@ -3531,57 +3538,35 @@ sub run_testcase_need_slave_restart($)
# We try to find out if we are to restart the slaves # We try to find out if we are to restart the slaves
my $do_slave_restart= 0; # Assumes we don't have to my $do_slave_restart= 0; # Assumes we don't have to
# FIXME only restart slave when necessary if ( $max_slave_num == 0)
$do_slave_restart= 1; {
mtr_verbose("No testcase use slaves, no slave restarts");
# if ( ! $slave->[0]->{'pid'} ) }
# { else
# # mtr_verbose("Slave not started, no need to check slave restart"); {
# }
# elsif ( $do_restart ) # Check if any slave is currently started
# { my $any_slave_started= 0;
# $do_slave_restart= 1; # Always restart if master restart foreach my $mysqld (@{$slave})
# mtr_verbose("Restart slave because: Master restart"); {
# } if ( $mysqld->{'pid'} )
# elsif ( $tinfo->{'slave_sh'} ) {
# { $any_slave_started= 1;
# $do_slave_restart= 1; # Always restart if script to run last;
# mtr_verbose("Restart slave because: Always restart if script to run"); }
# } }
# elsif ( ! $opt_skip_ndbcluster_slave and
# $tinfo->{'ndb_test'} == 0 and if ($any_slave_started)
# $clusters->[1]->{'pid'} != 0 ) {
# { mtr_verbose("Any slave is started, need to restart");
# $do_slave_restart= 1; # Restart without slave cluster $do_slave_restart= 1;
# mtr_verbose("Restart slave because: Test does not need slave cluster"); }
# } elsif ( $tinfo->{'slave_num'} )
# elsif ( ! $opt_with_ndbcluster_slave and {
# $tinfo->{'ndb_test'} == 1 and mtr_verbose("Test need slave, check for restart");
# $clusters->[1]->{'pid'} == 0 ) $do_slave_restart= 1;
# { }
# $do_slave_restart= 1; # Restart with slave cluster }
# mtr_verbose("Restart slave because: Test need slave cluster");
# }
# elsif ( $tinfo->{'slave_restart'} )
# {
# $do_slave_restart= 1;
# mtr_verbose("Restart slave because: slave_restart");
# }
# elsif ( $slave->[0]->{'running_slave_is_special'} )
# {
# $do_slave_restart= 1;
# mtr_verbose("Restart slave because: running_slave_is_special");
# }
# # Check that running slave was started with same options
# # as the current test requires
# elsif (! mtr_same_opts($slave->[0]->{'start_opts'},
# $tinfo->{'slave_opt'}) )
# {
# $do_slave_restart= 1;
# mtr_verbose("Restart slave because: running with different options '" .
# join(" ", @{$tinfo->{'slave_opt'}}) . "' != '" .
# join(" ", @{$slave->[0]->{'start_opts'}}) . "'" );
# }
return $do_slave_restart; return $do_slave_restart;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment