List:Commits« Previous MessageNext Message »
From:Magnus Svensson Date:July 24 2008 6:27pm
Subject:bzr commit into mysql-6.0-backup branch (msvensson:2688)
View as plain text  
#At file:///data/msvensson/mysql/6.0-rpl/

 2688 Magnus Svensson	2008-07-24
      Fix paths
      Recommit the patch that enables the test script to shutdown
      a server and control when it shoudl start up again
      Add suppression specific to testcases
modified:
  mysql-test/include/maria_empty_logs.inc
  mysql-test/include/maria_make_snapshot.inc
  mysql-test/include/maria_make_snapshot_for_feeding_recovery.inc
  mysql-test/include/maria_verify_recovery.inc
  mysql-test/lib/mtr_io.pl
  mysql-test/mysql-test-run.pl
  mysql-test/r/maria-recover.result
  mysql-test/r/maria-recovery2.result
  mysql-test/t/maria-recover.test
  mysql-test/t/maria-recovery.test
  mysql-test/t/maria-recovery2.test

=== modified file 'mysql-test/include/maria_empty_logs.inc'
--- a/mysql-test/include/maria_empty_logs.inc	2008-07-22 18:08:06 +0000
+++ b/mysql-test/include/maria_empty_logs.inc	2008-07-24 18:26:12 +0000
@@ -10,11 +10,12 @@ let $MYSQLD_DATADIR= `SELECT @@datadir`;
 
 connection admin;
 -- echo * shut down mysqld, removed logs, restarted it
-append_file $MYSQLTEST_VARDIR/tmp/master0.expect;
+append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
 wait-maria_empty_logs.inc
 EOF
 
---exec $MYSQLADMIN --no-defaults -S $MASTER_MYSOCK -P $MASTER_MYPORT  -u root --password= shutdown 2>&1;
+# Shutdown server and kill it if not stopped within 60 secs
+shutdown_server 60;
 
 if (!$mel_keep_control_file)
 {
@@ -66,7 +67,7 @@ remove_file $MYSQLD_DATADIR/$MARIA_LOG/m
 -- error 0,1
 remove_file $MYSQLD_DATADIR/maria_recovery.trace;
 
-append_file $MYSQLTEST_VARDIR/tmp/master0.expect;
+append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
 restart-maria_empty_logs.inc
 EOF
 

=== modified file 'mysql-test/include/maria_make_snapshot.inc'
--- a/mysql-test/include/maria_make_snapshot.inc	2008-07-23 17:58:12 +0000
+++ b/mysql-test/include/maria_make_snapshot.inc	2008-07-24 18:26:12 +0000
@@ -15,7 +15,6 @@
 # 3) set $mms_purpose to say what this copy is for (influences the naming
 # of the spare directory).
 
-let $MYSQLD_DATADIR= `SELECT @@datadir`;
 if ($mms_copy)
 {
   --echo * copied $mms_tname$mms_table_to_use for $mms_purpose

=== modified file 'mysql-test/include/maria_make_snapshot_for_feeding_recovery.inc'
--- a/mysql-test/include/maria_make_snapshot_for_feeding_recovery.inc	2008-07-23 17:58:12 +0000
+++ b/mysql-test/include/maria_make_snapshot_for_feeding_recovery.inc	2008-07-24 18:26:12 +0000
@@ -33,6 +33,6 @@ let $mms_copy=0;
 let $MYSQLD_DATADIR= `SELECT @@datadir`;
 -- error 0,1
 remove_file $MYSQLTEST_VARDIR/tmp/mms_for_$mms_purpose.maria_log_control;
-copy_file $MYSQLTEST_DATADIR/$MARIA_LOG/maria_log_control $MYSQLTEST_VARDIR/tmp/mms_for_$mms_purpose.maria_log_control;
+copy_file $MYSQLD_DATADIR/$MARIA_LOG/maria_log_control $MYSQLTEST_VARDIR/tmp/mms_for_$mms_purpose.maria_log_control;
 
 connection default;

=== modified file 'mysql-test/include/maria_verify_recovery.inc'
--- a/mysql-test/include/maria_verify_recovery.inc	2008-07-23 17:58:12 +0000
+++ b/mysql-test/include/maria_verify_recovery.inc	2008-07-24 18:26:12 +0000
@@ -20,11 +20,11 @@ let $mms_compare_physically_save=$mms_co
 let $mms_compare_physically=0;
 
 # warn mtr that mysqld is going to die and should not be restarted immediately
-#append_file $MYSQLTEST_VARDIR/tmp/master0.expect;
+#append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
 #wait-maria_verify_recovery.inc
 #EOF
 # todo: remove this "system" and uncomment above when BUG#32296 is fixed
-system echo wait-maria_verify_recovery.inc >> $MYSQLTEST_VARDIR/tmp/master0.expect;
+system echo wait-maria_verify_recovery.inc >> $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
 
 # flush page cache and log, only log, or nothing, and kill mysqld with
 # abort().
@@ -55,7 +55,6 @@ if ($mvr_restore_old_snapshot)
 
   # also copy back control file, to force recovery to start from an early
   # point, ignoring further checkpoints.
-  let $MYSQLD_DATADIR= `SELECT @@datadir`;
   -- error 0,1
   remove_file $MYSQLD_DATADIR/$MARIA_LOG/maria_log_control;
   copy_file $MYSQLTEST_VARDIR/tmp/mms_for_$mms_purpose.maria_log_control $MYSQLD_DATADIR/$MARIA_LOG/maria_log_control;
@@ -63,10 +62,10 @@ if ($mvr_restore_old_snapshot)
 
 --echo * recovery happens
 # let mtr restart mysqld (and thus execute the maria log)
-#append_file $MYSQLTEST_VARDIR/tmp/master0.expect;
+#append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
 #restart-maria_verify_recovery.inc
 #EOF
-system echo restart-maria_verify_recovery.inc >> $MYSQLTEST_VARDIR/tmp/master0.expect;
+system echo restart-maria_verify_recovery.inc >> $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
 
 --source include/wait_until_connected_again.inc
 

=== modified file 'mysql-test/lib/mtr_io.pl'
--- a/mysql-test/lib/mtr_io.pl	2008-07-22 14:16:22 +0000
+++ b/mysql-test/lib/mtr_io.pl	2008-07-24 18:26:12 +0000
@@ -26,6 +26,7 @@ sub mtr_tonewfile($@);
 sub mtr_appendfile_to_file ($$);
 sub mtr_grab_file($);
 sub mtr_printfile($);
+sub mtr_lastlinefromfile($);
 
 
 # Read a whole file, stripping leading and trailing whitespace.
@@ -94,5 +95,17 @@ sub mtr_printfile($) {
   return;
 }
 
+sub mtr_lastlinefromfile ($) {
+  my $file=  shift;
+  my $text;
+
+  open(FILE,"<",$file) or mtr_error("can't open file \"$file\": $!");
+  while (my $line= <FILE>)
+  {
+    $text= $line;
+  }
+  close FILE;
+  return $text;
+}
 
 1;

=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl	2008-07-23 13:23:07 +0000
+++ b/mysql-test/mysql-test-run.pl	2008-07-24 18:26:12 +0000
@@ -2697,10 +2697,29 @@ sub check_expected_crash_and_restart {
     my $expect_file= "$opt_vardir/tmp/".$mysqld->name().".expect";
     if ( -f $expect_file )
     {
-      mtr_report("Crash was expected, file '$expect_file' exists");
-      # Start server with same settings as last time
-      mysqld_start($mysqld, $mysqld->{'started_opts'});
-      unlink($expect_file);
+      mtr_verbose("Crash was expected, file '$expect_file' exists");
+
+      while (1){
+
+	# If last line in expect file starts with "wait"
+	# sleep a little and try again, thus allowing the
+	# test script to control when the server should start
+	# up again
+	my $last_line= mtr_lastlinefromfile($expect_file);
+	if ($last_line =~ /^wait/ )
+	{
+	  mtr_verbose("Test says wait before restart");
+	  mtr_milli_sleep(100);
+	  next;
+	}
+
+	unlink($expect_file);
+
+	# Start server with same settings as last time
+	mysqld_start($mysqld, $mysqld->{'started_opts'});
+
+	last;
+      }
     }
 
     return 1;

=== modified file 'mysql-test/r/maria-recover.result'
--- a/mysql-test/r/maria-recover.result	2008-06-28 09:54:53 +0000
+++ b/mysql-test/r/maria-recover.result	2008-07-24 18:26:12 +0000
@@ -1,3 +1,6 @@
+call mtr.add_supression("Checking table:   '.\/mysqltest\/t_corrupted2'");
+call mtr.add_supression("Recovering table: '.\/mysqltest\/t_corrupted2'");
+call mtr.add_supression("Table '.\/mysqltest\/t_corrupted2' is marked as crashed and should be repaired");
 select @@global.maria_recover;
 @@global.maria_recover
 BACKUP

=== modified file 'mysql-test/r/maria-recovery2.result'
--- a/mysql-test/r/maria-recovery2.result	2008-06-30 09:59:59 +0000
+++ b/mysql-test/r/maria-recovery2.result	2008-07-24 18:26:12 +0000
@@ -1,3 +1,5 @@
+call mtr.add_supression("File '.*maria_log.000.*' not found \\(Errcode: 2\\)");
+call mtr.add_supression("Table '.\/mysqltest\/t_corrupted1' is crashed, skipping it. Please repair it with maria_chk -r");
 set global maria_log_file_size=4294967295;
 drop database if exists mysqltest;
 create database mysqltest;

=== modified file 'mysql-test/t/maria-recover.test'
--- a/mysql-test/t/maria-recover.test	2008-07-23 12:27:46 +0000
+++ b/mysql-test/t/maria-recover.test	2008-07-24 18:26:12 +0000
@@ -2,6 +2,10 @@
 
 --source include/have_maria.inc
 
+call mtr.add_supression("Checking table:   '.\/mysqltest\/t_corrupted2'");
+call mtr.add_supression("Recovering table: '.\/mysqltest\/t_corrupted2'");
+call mtr.add_supression("Table '.\/mysqltest\/t_corrupted2' is marked as crashed and should be repaired");
+
 # Note: we're setting an environment variable (not prefixing it by $),
 # so that the perl code below can access it.
 let MYSQLD_DATADIR= `select @@datadir`;

=== modified file 'mysql-test/t/maria-recovery.test'
--- a/mysql-test/t/maria-recovery.test	2008-06-30 09:59:59 +0000
+++ b/mysql-test/t/maria-recovery.test	2008-07-24 18:26:12 +0000
@@ -6,7 +6,7 @@
 --source include/have_maria.inc
 
 set global maria_log_file_size=4294967295;
-let $MARIA_LOG=../tmp;
+let $MARIA_LOG=../../tmp;
 
 --disable_warnings
 drop database if exists mysqltest;

=== modified file 'mysql-test/t/maria-recovery2.test'
--- a/mysql-test/t/maria-recovery2.test	2008-06-30 09:34:58 +0000
+++ b/mysql-test/t/maria-recovery2.test	2008-07-24 18:26:12 +0000
@@ -5,8 +5,11 @@
 --source include/have_debug.inc
 --source include/have_maria.inc
 
+call mtr.add_supression("File '.*maria_log.000.*' not found \\(Errcode: 2\\)");
+call mtr.add_supression("Table '.\/mysqltest\/t_corrupted1' is crashed, skipping it. Please repair it with maria_chk -r");
+
 set global maria_log_file_size=4294967295;
-let $MARIA_LOG=../tmp;
+let $MARIA_LOG=../../tmp;
 
 --disable_warnings
 drop database if exists mysqltest;

Thread
bzr commit into mysql-6.0-backup branch (msvensson:2688) Magnus Svensson24 Jul