List:Commits« Previous MessageNext Message »
From:msvensson Date:February 6 2006 1:13pm
Subject:bk commit into 5.0 tree (msvensson:1.2021)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of msvensson. When msvensson does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2021 06/02/06 13:13:43 msvensson@neptunus.(none) +3 -0
  Start cluster only for testcases that really needs it and stop it when 
  not needed by the tescases. This will save test time for those testcases
  that does not need cluster, but need a restart, as they dont have to wait
  the extra time it would take for cluster to restart. It will also save
  time for testcases that does not require a restart, as cluster does not 
  need to be contacted for each table to be dropped or created.   

  mysql-test/mysql-test-run.pl
    1.61 06/02/06 13:13:38 msvensson@neptunus.(none) +22 -10
    Only start ndbcluster for testcases that needs it.

  mysql-test/lib/mtr_report.pl
    1.19 06/02/06 13:13:38 msvensson@neptunus.(none) +7 -1
    Print a * after testname of testcases that requires a restart.

  mysql-test/lib/mtr_cases.pl
    1.13 06/02/06 13:13:38 msvensson@neptunus.(none) +28 -0
    Mark all ndb_* test cases as ndbcluster needed
    Mark all testcases with a*_master.opt filer containing "--ndbcluster" as ndbcluster
needed

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	msvensson
# Host:	neptunus.(none)
# Root:	/home/msvensson/mysql/mysqltestrun_faster/my50-mysqltestrun_faster

--- 1.12/mysql-test/lib/mtr_cases.pl	2005-10-16 20:31:44 +02:00
+++ 1.13/mysql-test/lib/mtr_cases.pl	2006-02-06 13:13:38 +01:00
@@ -252,6 +252,21 @@
     $tinfo->{'slave_restart'}= 1;
   }
 
+  # Cluster is needed by test case if testname is ndb_*
+  $tinfo->{'ndbcluster'}= 0; # Default value
+  if ( defined mtr_match_prefix($tname,"ndb") )
+  {
+    if ( $::opt_skip_ndbcluster )
+    {
+      $tinfo->{'skip'}= 1;
+      return;
+    }
+    else
+    {
+      $tinfo->{'ndbcluster'}= 1;
+    }
+  }
+
   # FIXME what about embedded_server + ndbcluster, skip ?!
 
   my $master_opt_file= "$testdir/$tname-master.opt";
@@ -310,6 +325,19 @@
           $tinfo->{'master_opt'}= [];
         }
 
+	# Cluster is needed if opt file contains --ndbcluster
+        if ( $opt eq "--ndbcluster" )
+        {
+	  if ( $::opt_skip_ndbcluster )
+	  {
+	    $tinfo->{'skip'}= 1;
+	    return;
+	  }
+	  else
+	  {
+	    $tinfo->{'ndbcluster'}= 1;
+	  }
+	}
       }
 
       # Ok, this was a real option list, add it

--- 1.18/mysql-test/lib/mtr_report.pl	2005-09-30 22:37:50 +02:00
+++ 1.19/mysql-test/lib/mtr_report.pl	2006-02-06 13:13:38 +01:00
@@ -74,8 +74,14 @@
 
 sub mtr_report_test_name ($) {
   my $tinfo= shift;
+  my $name= $tinfo->{'name'};
 
-  printf "%-30s ", $tinfo->{'name'};
+  # Add a * to test name if it needs restarting
+  if ( $tinfo->{'master_restart'} )
+  {
+    $name="$name*";
+  }
+  printf "%-30s ", $name;
 }
 
 sub mtr_report_test_skipped ($) {

--- 1.60/mysql-test/mysql-test-run.pl	2006-01-09 18:16:51 +01:00
+++ 1.61/mysql-test/mysql-test-run.pl	2006-02-06 13:13:38 +01:00
@@ -305,6 +305,7 @@
 our $path_ndb_backup_dir;
 our $file_ndb_testrun_log;
 our $flag_ndb_status_ok= 1;
+our $flag_use_ndbcluster= 0;
 
 ######################################################################
 #
@@ -1730,7 +1731,9 @@
   if ( ! $glob_use_running_server and ! $glob_use_embedded_server )
   {
     if ( $tinfo->{'master_restart'} or
-         $master->[0]->{'running_master_is_special'} )
+         $master->[0]->{'running_master_is_special'} or
+	 $tinfo->{'ndbcluster'} == $master->[0]->{'ndbcluster'}
+       )
     {
       stop_masters();
       $master->[0]->{'running_master_is_special'}= 0; # Forget why we stopped
@@ -1770,6 +1773,9 @@
   # Start masters
   # ----------------------------------------------------------------------
 
+  # If the testcase needs cluster, set the global flag
+  $flag_use_ndbcluster= $tinfo->{'ndbcluster'};
+
   if ( ! $glob_use_running_server and ! $glob_use_embedded_server )
   {
     # FIXME give the args to the embedded server?!
@@ -1781,12 +1787,17 @@
     {
       if ( $master->[0]->{'ndbcluster'} )
       {
-	$master->[0]->{'ndbcluster'}= ndbcluster_start();
-        if ( $master->[0]->{'ndbcluster'} )
-        {
-          report_failure_and_restart($tinfo);
-          return;
-        }
+	# Cluster is not started
+	if ( $tinfo->{'ndbcluster'} )
+	{
+	  # Test needs cluster, start it
+	  $master->[0]->{'ndbcluster'}= ndbcluster_start();
+	  if ( $master->[0]->{'ndbcluster'} )
+	  {
+	    report_failure_and_restart($tinfo);
+	    return;
+	  }
+	}
       }
       if ( ! $master->[0]->{'pid'} )
       {
@@ -1800,8 +1811,9 @@
           return;
         }
       }
-      if ( $opt_with_ndbcluster and ! $master->[1]->{'pid'} )
+      if ( $tinfo->{'ndbcluster'} and ! $master->[1]->{'pid'} )
       {
+	# Test needs cluster, start an extra mysqld connected to cluster
         $master->[1]->{'pid'}=
           mysqld_start('master',1,$tinfo->{'master_opt'},[]);
         if ( ! $master->[1]->{'pid'} )
@@ -2104,7 +2116,7 @@
       mtr_add_arg($args, "%s--skip-innodb", $prefix);
     }
 
-    if ( $opt_skip_ndbcluster )
+    if ( $opt_skip_ndbcluster || !$flag_use_ndbcluster)
     {
       mtr_add_arg($args, "%s--skip-ndbcluster", $prefix);
     }
@@ -2180,7 +2192,7 @@
     }
   }
 
-  if ( $opt_with_ndbcluster )
+  if ( $flag_use_ndbcluster )
   {
     mtr_add_arg($args, "%s--ndbcluster", $prefix);
     mtr_add_arg($args, "%s--ndb-connectstring=%s", $prefix,
Thread
bk commit into 5.0 tree (msvensson:1.2021)msvensson6 Feb