MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Bjorn Munch Date:October 14 2009 7:32am
Subject:bzr commit into mysql-5.1-mtr branch (Bjorn.Munch:2846) Bug#46007
View as plain text  
#At file:///home/bm136801/my/46007-51/ based on revid:bjorn.munch@stripped

 2846 Bjorn Munch	2009-10-14
      Bug #46007 Tests fail due to a crash while running 'check testcase before test'
      Difficult to debug due to lacking report
      This does not solve the real issue, but extracts server log when it happens
      Forst commit was incomplete, didn't cover all cases

    modified:
      mysql-test/mysql-test-run.pl
=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl	2009-10-09 13:16:36 +0000
+++ b/mysql-test/mysql-test-run.pl	2009-10-14 07:31:34 +0000
@@ -3015,7 +3015,8 @@ test case was executed:\n";
       # Unknown process returned, most likley a crash, abort everything
       $tinfo->{comment}=
 	"The server $proc crashed while running ".
-	"'check testcase $mode test'";
+	"'check testcase $mode test'".
+	get_log_from_proc($proc, $tinfo->{name});
       $result= 3;
     }
 
@@ -3133,7 +3134,8 @@ sub run_on_all($$)
     else {
       # Unknown process returned, most likley a crash, abort everything
       $tinfo->{comment}.=
-	"The server $proc crashed while running '$run'";
+	"The server $proc crashed while running '$run'".
+	get_log_from_proc($proc, $tinfo->{name});
     }
 
     # Kill any check processes still running
@@ -3533,7 +3535,8 @@ sub run_testcase ($) {
     {
       # Server failed, probably crashed
       $tinfo->{comment}=
-	"Server $proc failed during test run";
+	"Server $proc failed during test run" .
+	get_log_from_proc($proc, $tinfo->{name});
 
       # ----------------------------------------------------
       # It's not mysqltest that has exited, kill it
@@ -3588,12 +3591,11 @@ sub run_testcase ($) {
 }
 
 
+# Extract server log from after the last occurrence of named test
+# Return as an array of lines
 #
-# Perform a rough examination of the servers
-# error log and write all lines that look
-# suspicious into $error_log.warnings
-#
-sub extract_warning_lines ($$) {
+
+sub extract_server_log ($$) {
   my ($error_log, $tname) = @_;
 
   # Open the servers .err log file and read all lines
@@ -3645,8 +3647,37 @@ sub extract_warning_lines ($$) {
       }
     }
   }
+  return @lines;
+}
+
+# Get log from server identified from its $proc object, from named test
+# Return as a single string
+#
+
+sub get_log_from_proc ($$) {
+  my ($proc, $name)= @_;
+  my $srv_log= "";
+
+  foreach my $mysqld (mysqlds()) {
+    if ($mysqld->{proc} eq $proc) {
+      my @srv_lines= extract_server_log($mysqld->value('#log-error'), $name);
+      $srv_log= "\nServer log from this test:\n" . join ("", @srv_lines);
+      last;
+    }
+  }
+  return $srv_log;
+}
+
+# Perform a rough examination of the servers
+# error log and write all lines that look
+# suspicious into $error_log.warnings
+#
+sub extract_warning_lines ($$) {
+  my ($error_log, $tname) = @_;
+
+  my @lines= extract_server_log($error_log, $tname);
 
-  # Write all suspicious lines to $error_log.warnings file
+# Write all suspicious lines to $error_log.warnings file
   my $warning_log = "$error_log.warnings";
   my $Fwarn = IO::File->new($warning_log, "w")
     or die("Could not open file '$warning_log' for writing: $!");
@@ -3829,7 +3860,8 @@ sub check_warnings ($) {
     else {
       # Unknown process returned, most likley a crash, abort everything
       $tinfo->{comment}=
-	"The server $proc crashed while running 'check warnings'";
+	"The server $proc crashed while running 'check warnings'".
+	get_log_from_proc($proc, $tinfo->{name});
       $result= 3;
     }
 


Attachment: [text/bzr-bundle] bzr/bjorn.munch@sun.com-20091014073134-v1dctxszy9q0ln95.bundle
Thread
bzr commit into mysql-5.1-mtr branch (Bjorn.Munch:2846) Bug#46007Bjorn Munch14 Oct