Below is the list of changes that have just been committed into a local
4.1 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@stripped, 2006-10-24 17:36:46+02:00, msvensson@neptunus.(none) +2 -0
Add analyze_testcase_failure which is called when mysqltest has failed
with error 1 and we are running with --force
The specific "analyze" code is enclosed in a .test file fwich can easily
be modified to be more advanced
mysql-test/include/analyze_failure_sync_with_master.test@stripped, 2006-10-24 17:36:45+02:00,
msvensson@neptunus.(none) +15 -0
New BitKeeper file ``mysql-test/include/analyze_failure_sync_with_master.test''
mysql-test/include/analyze_failure_sync_with_master.test@stripped, 2006-10-24 17:36:45+02:00,
msvensson@neptunus.(none) +0 -0
mysql-test/mysql-test-run.pl@stripped, 2006-10-24 17:36:45+02:00, msvensson@neptunus.(none)
+56 -0
Attempt to run some quick queries to analyze the failure when mysqltest returns 1
indicating test has failed
Initially only code to analyze "could not sync with master" is added as that is a
blackbox
and all problems looks the same
# 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/mysql-4.1-maint
--- 1.127/mysql-test/mysql-test-run.pl 2006-10-24 17:36:49 +02:00
+++ 1.128/mysql-test/mysql-test-run.pl 2006-10-24 17:36:49 +02:00
@@ -2923,6 +2923,58 @@
}
+sub analyze_testcase_failure_sync_with_master($)
+{
+ my ($tinfo)= @_;
+ mtr_verbose("analyze_testcase_failure_sync_with_master");
+ print "analyze_testcase_failure_sync_with_master\n";
+
+ my $args;
+ mtr_init_args(\$args);
+
+ mtr_add_arg($args, "--no-defaults");
+ mtr_add_arg($args, "--silent");
+ mtr_add_arg($args, "-v");
+ mtr_add_arg($args, "--skip-safemalloc");
+ mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir);
+
+ mtr_add_arg($args, "--socket=%s", $master->[0]->{'path_sock'});
+ mtr_add_arg($args, "--port=%d", $master->[0]->{'port'});
+ mtr_add_arg($args, "--database=test");
+ mtr_add_arg($args, "--user=%s", $opt_user);
+ mtr_add_arg($args, "--password=");
+
+ # Run the test file and append output to log file
+ mtr_run_test($exe_mysqltest,$args,
+ "include/analyze_failure_sync_with_master.test",
+ "$path_timefile", "$path_timefile","",
+ { append_log_file => 1 });
+
+}
+
+sub analyze_testcase_failure($)
+{
+ my ($tinfo)= @_;
+
+ # Open mysqltest.log
+ my $F= IO::File->new($path_timefile) or
+ mtr_error("can't open file \"$path_timefile\": $!");
+
+ while ( my $line= <$F> )
+ {
+ # Look for "mysqltest: At line nnn: <error>
+ if ( $line =~ /mysqltest: At line [0-9]*: (.*)/ )
+ {
+ my $error= $1;
+ # Look for "could not sync with master"
+ if ( $error =~ /could not sync with master/ )
+ {
+ analyze_testcase_failure_sync_with_master($tinfo);
+ }
+ }
+ }
+}
+
##############################################################################
#
# Run a single test case
@@ -3011,6 +3063,10 @@
}
elsif ( $res == 1 )
{
+ if ( $opt_force )
+ {
+ analyze_testcase_failure($tinfo);
+ }
# Test case failure reported by mysqltest
report_failure_and_restart($tinfo);
}
--- New file ---
+++ mysql-test/include/analyze_failure_sync_with_master.test 06/10/24 17:36:45
# Connect to both master and slave
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);
vertical_results;
echo == MASTER ===========================================================;
connection master;
show master status;
show slave status;
echo == SLAVE ===========================================================;
connection slave;
show master status;
show slave status;
| Thread |
|---|
| • bk commit into 4.1 tree (msvensson:1.2600) | msvensson | 24 Oct |