My previous fix for not ignoring warnings during server shutdown would
terminate the test suite completely in case of extra warnings,
omitting the error summary at the end.
This patch provides a much nicer summary report which includes all
test sequences that had warnings during shutdown.
Also add a $fail flag to make 100% sure mysql-test-run.pl will return
failure for any kind of problem occured during the test suite.
Also revert wrong "internal error" message from earlier patch.
---
mysql-test/lib/mtr_report.pm | 21 ++++++++++++++++++++-
mysql-test/mysql-test-run.pl | 27 ++++++++++++++-------------
2 files changed, 34 insertions(+), 14 deletions(-)
Index: work-5.1-buildbot/mysql-test/lib/mtr_report.pm
===================================================================
--- work-5.1-buildbot.orig/mysql-test/lib/mtr_report.pm 2009-04-07 13:40:41.000000000 +0200
+++ work-5.1-buildbot/mysql-test/lib/mtr_report.pm 2009-04-07 13:40:56.000000000 +0200
@@ -187,8 +187,10 @@ sub mtr_report_test ($) {
}
-sub mtr_report_stats ($) {
+sub mtr_report_stats ($$$) {
+ my $fail= shift;
my $tests= shift;
+ my $extra_warnings= shift;
# ----------------------------------------------------------------------
# Find out how we where doing
@@ -325,10 +327,27 @@ sub mtr_report_stats ($) {
print "All $tot_tests tests were successful.\n\n";
}
+ if (@$extra_warnings)
+ {
+ print <remove($sock);
if (--$childs == 0){
$suite_timeout_proc->kill();
- return ($completed, $test_failure);
+ return ($test_failure, $completed, $extra_warnings);
}
next;
}
@@ -519,14 +517,14 @@ sub run_test_server ($$$) {
# Test has failed, force is off
$suite_timeout_proc->kill();
push(@$completed, $result);
- return ($completed, 1);
+ return (1, $completed, $extra_warnings);
}
elsif ($opt_max_test_fail > 0 and
$num_failed_test >= $opt_max_test_fail) {
$suite_timeout_proc->kill();
mtr_report("Too many tests($num_failed_test) failed!",
"Terminating...");
- return (undef, 1);
+ return (1, $completed, $extra_warnings);
}
$num_failed_test++;
}
@@ -580,13 +578,14 @@ sub run_test_server ($$$) {
elsif ($line eq 'WARNINGS'){
my $fake_test= My::Test::read_test($sock);
my $test_list= join (" ", @{$fake_test->{testnames}});
+ push @$extra_warnings, $test_list;
mtr_report("***Warnings generated in error logs during shutdown ".
"after running tests: $test_list");
$test_failure= 1;
if ( !$opt_force ) {
# Test failure due to warnings, force is off
$suite_timeout_proc->kill();
- return ($completed, 1);
+ return (1, $completed, $extra_warnings);
}
} else {
mtr_error("Unknown response: '$line' from client");
@@ -666,7 +665,7 @@ sub run_test_server ($$$) {
if ( ! $suite_timeout_proc->wait_one(0) )
{
mtr_report("Test suite timeout! Terminating...");
- return (undef, 1);
+ return (1, $completed, $extra_warnings);
}
}
}
@@ -758,7 +757,9 @@ sub run_worker ($) {
}
}
- die "Internal error: should not reach this place.";
+ stop_all_servers();
+
+ exit(1);
}
--