List:Internals« Previous MessageNext Message »
From:Alexander Nozdrin Date:September 20 2005 6:03pm
Subject:bk commit into 5.0 tree (anozdrin:1.1987)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of alik. When alik 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.1987 05/09/20 20:03:17 anozdrin@stripped +3 -0
  WL#2789 "Instance Manager: test using mysql-test-run testing framework"
  1) Add support to testing Instance Manager in daemon mode;
  2) Don't run Instance Manager tests when running with --ps-protocol option.

  mysql-test/mysql-test-run.pl
    1.45 05/09/20 20:03:11 anozdrin@stripped +8 -0
    WL#2789 "Instance Manager: test using mysql-test-run testing framework"
    Add support for testing Instance Manager in daemon mode.

  mysql-test/lib/mtr_process.pl
    1.22 05/09/20 20:03:11 anozdrin@stripped +8 -6
    WL#2789 "Instance Manager: test using mysql-test-run testing framework"
    Make several attempts (i.e. send several signals to process) while trying to kill it.

  mysql-test/lib/mtr_cases.pl
    1.11 05/09/20 20:03:11 anozdrin@stripped +26 -17
    WL#2789 "Instance Manager: test using mysql-test-run testing framework"
    Skip/disable Instance Manager tests in the following cases:
      - we are testing embedded server;
      - we are running with --ps-protocol;
      - Instance Manager executable does not exist;
    Report about the reason in the standard way.

# 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:	anozdrin
# Host:	station.home
# Root:	/home/alik/Documents/AllProgs/MySQL/devel/5.0-im-tests

--- 1.10/mysql-test/lib/mtr_cases.pl	2005-08-29 22:28:33 +04:00
+++ 1.11/mysql-test/lib/mtr_cases.pl	2005-09-20 20:03:11 +04:00
@@ -61,22 +61,6 @@
         $elem= $tname;
         $tname =~ s/\.imtest$//;
         $component_id= 'im';
-
-        if ( $::glob_use_embedded_server )
-        {
-          mtr_report(
-            "Instance Manager's tests are not available in embedded mode." .
-            "Test case '$tname' is skipped.");
-          next;
-        }
-
-        unless ( $::exe_im )
-        {
-          mtr_report(
-            "Instance Manager executable is unavailable. " .
-            "Test case '$tname' is skipped.");
-          next;
-        }
       }
 
       # If target component is known, check that the specified test case
@@ -115,7 +99,7 @@
           $component_id= 'im';
         }
       }
-      
+
       collect_one_test_case($testdir,$resdir,$tname,$elem,$cases,{},
         $component_id);
     }
@@ -401,6 +385,31 @@
     $tinfo->{'skip'}= 1;
     $tinfo->{'disable'}= 1;   # Sub type of 'skip'
     $tinfo->{'comment'}= mtr_fromfile($disabled_file);
+  }
+
+  if ( $component_id eq 'im' )
+  {
+    if ( $::glob_use_embedded_server )
+    {
+      $tinfo->{'skip'}= 1;
+      $tinfo->{'disable'}= 1;   # Sub type of 'skip'
+      $tinfo->{'comment'}=
+        "Instance Manager's tests are not available in embedded mode.";
+    }
+    elsif ( $::opt_ps_protocol )
+    {
+      $tinfo->{'skip'}= 1;
+      $tinfo->{'disable'}= 1;   # Sub type of 'skip'
+      $tinfo->{'comment'}=
+        "Instance Manager's tests are not run with --ps-protocol.";
+    }
+    elsif ( !$::exe_im )
+    {
+      $tinfo->{'skip'}= 1;
+      $tinfo->{'disable'}= 1;   # Sub type of 'skip'
+      $tinfo->{'comment'}=
+        "Instance Manager executable is unavailable.";
+    }
   }
 
   # We can't restart a running server that may be in use

--- 1.21/mysql-test/lib/mtr_process.pl	2005-09-14 16:34:41 +04:00
+++ 1.22/mysql-test/lib/mtr_process.pl	2005-09-20 20:03:11 +04:00
@@ -847,14 +847,16 @@
 sub mtr_kill_processes ($) {
   my $pids = shift;
 
-  foreach my $sig (15,9)
+  foreach my $sig (15, 9)
   {
-    my $retries= 20;                    # FIXME 20 seconds, this is silly!
-    kill($sig, @{$pids});
-    while ( $retries-- and  kill(0, @{$pids}) )
+    my $retries= 10;
+    while (1)
     {
-      mtr_debug("Sleep 1 second waiting for processes to die");
-      sleep(1)                      # Wait one second
+      kill($sig, @{$pids});
+      last unless kill (0, @{$pids}) and $retries--;
+
+      mtr_debug("Sleep 2 second waiting for processes to die");
+      sleep(2);
     }
   }
 }

--- 1.44/mysql-test/mysql-test-run.pl	2005-09-19 17:31:06 +04:00
+++ 1.45/mysql-test/mysql-test-run.pl	2005-09-20 20:03:11 +04:00
@@ -992,6 +992,8 @@
 # $ENV{'MYSQL_TCP_PORT'}=     '@MYSQL_TCP_PORT@'; # FIXME
   $ENV{'MYSQL_TCP_PORT'}=     3306;
 
+  $ENV{'IM_PATH_PID'}=        $instance_manager->{path_pid};
+
   $ENV{'IM_MYSQLD1_SOCK'}=    $instance_manager->{instances}->[0]->{path_sock};
   $ENV{'IM_MYSQLD1_PORT'}=    $instance_manager->{instances}->[0]->{port};
   $ENV{'IM_MYSQLD2_SOCK'}=    $instance_manager->{instances}->[1]->{path_sock};
@@ -2287,6 +2289,12 @@
   {
     return;
   }
+
+  # Re-read pid from the file, since during tests Instance Manager could have
+  # been restarted, so its pid could have been changed.
+
+  $instance_manager->{'pid'} =
+    mtr_get_pid_from_file($instance_manager->{'path_pid'});
 
   # Inspired from mtr_stop_mysqld_servers().
 
Thread
bk commit into 5.0 tree (anozdrin:1.1987)Alexander Nozdrin20 Sep