MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Bjorn Munch Date:February 17 2010 11:38am
Subject:bzr commit into mysql-5.1-mtr branch (Bjorn.Munch:2894) Bug#44054
View as plain text  
#At file:///home/bm136801/my/noreord-51/ based on revid:bjorn.munch@stripped

 2894 Bjorn Munch	2010-02-17
      Bug #44054 MTR2: --no-reorder does not prevent reordering
      Some logic would group by suite always
      Disable this if using --noreorder
      Also fix getting array from collect_one_suite() in this case
      Amended according to previous comment

    modified:
      mysql-test/lib/mtr_cases.pm
      mysql-test/mysql-test-run.pl
=== modified file 'mysql-test/lib/mtr_cases.pm'
--- a/mysql-test/lib/mtr_cases.pm	2009-11-30 13:13:34 +0000
+++ b/mysql-test/lib/mtr_cases.pm	2010-02-17 11:37:37 +0000
@@ -40,7 +40,6 @@ our $default_storage_engine;
 our $opt_with_ndbcluster_only;
 our $defaults_file;
 our $defaults_extra_file;
-our $reorder= 1;
 our $quick_collect;
 
 sub collect_option {
@@ -99,7 +98,8 @@ sub init_pattern {
 #
 ##############################################################################
 
-sub collect_test_cases ($$) {
+sub collect_test_cases ($$$) {
+  my $opt_reorder= shift; # True if we're reordering tests
   my $suites= shift; # Semicolon separated list of test suites
   my $opt_cases= shift;
   my $cases= []; # Array of hash(one hash for each testcase)
@@ -118,10 +118,16 @@ sub collect_test_cases ($$) {
 		      !(IS_WINDOWS && $::opt_embedded_server) &&
 		      $lib_innodb_plugin);
 
-  foreach my $suite (split(",", $suites))
+  # If not reordering, we also shouldn't group by suites, unless
+  # no test cases were named.
+  # This also effects some logic in the loop following this.
+  if ($opt_reorder or !@$opt_cases)
   {
-    push(@$cases, collect_one_suite($suite, $opt_cases));
-    last if $some_test_found;
+    foreach my $suite (split(",", $suites))
+    {
+      push(@$cases, collect_one_suite($suite, $opt_cases));
+      last if $some_test_found;
+    }
   }
 
   if ( @$opt_cases )
@@ -135,6 +141,7 @@ sub collect_test_cases ($$) {
       my ($sname, $tname, $extension)= split_testname($test_name_spec);
       foreach my $test ( @$cases )
       {
+	last unless $opt_reorder;
 	# test->{name} is always in suite.name format
 	if ( $test->{name} =~ /.*\.$tname/ )
 	{
@@ -144,12 +151,13 @@ sub collect_test_cases ($$) {
       }
       if ( not $found )
       {
+	$sname= "main" if !$opt_reorder and !$sname;
 	mtr_error("Could not find '$tname' in '$suites' suite(s)") unless $sname;
-	# If suite was part of name, find it there
-	my ($this_case) = collect_one_suite($sname, [ $tname ]);
-	if ($this_case)
+	# If suite was part of name, find it there, may come with combinations
+	my @this_case = collect_one_suite($sname, [ $tname ]);
+	if (@this_case)
         {
-	  push (@$cases, $this_case);
+	  push (@$cases, @this_case);
 	}
 	else
 	{
@@ -159,7 +167,7 @@ sub collect_test_cases ($$) {
     }
   }
 
-  if ( $reorder && !$quick_collect)
+  if ( $opt_reorder && !$quick_collect)
   {
     # Reorder the test cases in an order that will make them faster to run
     my %sort_criteria;

=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl	2010-02-11 13:00:34 +0000
+++ b/mysql-test/mysql-test-run.pl	2010-02-17 11:37:37 +0000
@@ -222,6 +222,7 @@ my $opt_wait_all;
 my $opt_repeat= 1;
 my $opt_retry= 3;
 my $opt_retry_failure= env_or_val(MTR_RETRY_FAILURE => 2);
+my $opt_reorder= 1;
 
 my $opt_strace_client;
 
@@ -306,7 +307,7 @@ sub main {
   }
 
   mtr_report("Collecting tests...");
-  my $tests= collect_test_cases($opt_suites, \@opt_cases);
+  my $tests= collect_test_cases($opt_reorder, $opt_suites, \@opt_cases);
 
   if ( $opt_report_features ) {
     # Put "report features" as the first test to run
@@ -629,9 +630,9 @@ sub run_test_server ($$$) {
 	    next;
 	  }
 
-	  # Prefer same configuration
-	  if (defined $result and
-	      $result->{template_path} eq $t->{template_path})
+	  # Prefer same configuration, or just use next if --noreorder
+	  if (!$opt_reorder or (defined $result and
+	      $result->{template_path} eq $t->{template_path}))
 	  {
 	    #mtr_report("Test uses same config => good match");
 	    # Test uses same config => good match
@@ -902,7 +903,7 @@ sub command_line_setup {
              'report-features'          => \$opt_report_features,
              'comment=s'                => \$opt_comment,
              'fast'                     => \$opt_fast,
-             'reorder!'                 => \&collect_option,
+             'reorder!'                 => \$opt_reorder,
              'enable-disabled'          => \&collect_option,
              'verbose+'                 => \$opt_verbose,
              'verbose-restart'          => \&report_option,


Attachment: [text/bzr-bundle] bzr/bjorn.munch@sun.com-20100217113737-03yyuoxwdfp7h1rn.bundle
Thread
bzr commit into mysql-5.1-mtr branch (Bjorn.Munch:2894) Bug#44054Bjorn Munch17 Feb