From 8c97dc80ca0f1060dba183c95e29ed326ee7407b Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.mysql.com" <> Date: Fri, 2 May 2008 12:11:04 +0200 Subject: [PATCH] Print tests that has been run but shouldn't and vice versa Use opt_start_timeout also for ndb Remove the .result files generated by 'check_testcase' --- mysql-test/lib/mtr_report.pm | 12 +++++++++--- mysql-test/mysql-test-run.pl | 36 +++++++++++++++++++++++++++++------- 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/mysql-test/lib/mtr_report.pm b/mysql-test/lib/mtr_report.pm index 9e8e26459fe..cf884b41d55 100644 --- a/mysql-test/lib/mtr_report.pm +++ b/mysql-test/lib/mtr_report.pm @@ -131,8 +131,6 @@ sub mtr_report_test ($) { if ($tinfo->{'result'} eq 'MTR_RES_FAILED'){ - #my $test_failures= $tinfo->{'failures'} || 0; - #$tinfo->{'failures'}= $test_failures + 1; if ( defined $tinfo->{'warnings'} ) { mtr_report("[ fail ] Found warnings in server log file!"); @@ -233,7 +231,7 @@ sub mtr_report_stats ($) { $tot_tests++; $tot_passed++; } - elsif ( $tinfo->{'result'} eq 'MTR_RES_FAILED' ) + elsif ( $tinfo->{failures} ) { $tot_tests++; $tot_failed++; @@ -301,6 +299,14 @@ sub mtr_report_stats ($) { # Print a list of testcases that failed if ( $tot_failed != 0 ) { + + # Print each failed test, again + #foreach my $test ( @$tests ){ + # if ( $test->{result} eq 'MTR_RES_FAILED' ) { + # mtr_report_test($test); + # } + #} + my $ratio= $tot_passed * 100 / $tot_tests; print "Failed $tot_failed/$tot_tests tests, "; printf("%.2f", $ratio); diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 50348053bdf..4838ddefe54 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -322,15 +322,29 @@ sub main { if ( @$completed != $num_tests){ if ($opt_force){ - # All test should have been run, print the completed list - foreach my $test ( @$completed ){ - $test->print_test(); + # All test should have been run, print the ones that differs + my %tests= (); + foreach my $t (@$tests) { $tests{$t->key()}= 1; }; + foreach my $done ( @$completed ){ + if ($tests{$done->key()}) { + mtr_report("Found one extra completed"); + $done->print_test(); + } } + %tests= (); + foreach my $t (@$completed) { $tests{$t->key()}= 1; }; + foreach my $done ( @$tests ){ + if ($tests{$done->key()}) { + mtr_report("Found one test not run"); + $done->print_test(); + } + } + } # Not all tests completed, failure mtr_report(); - mtr_report("After @$completed of $num_tests."); + mtr_report(@$completed, " of $num_tests completed."); mtr_error("Test failed.", "To continue, re-run with '--force'"); } @@ -467,6 +481,7 @@ sub run_test_server { } else { mtr_report("\nRetrying test, attempt($retries/$opt_retry)...\n"); + delete($result->{result}); $result->{retries}= $retries+1; $result->write_test($sock, 'TESTCASE'); next; @@ -479,7 +494,7 @@ sub run_test_server { { $result->{retries}= 0; $result->{failures}= 0; - + delete($result->{result}); $result->{repeat}= $repeat+1; $result->write_test($sock, 'TESTCASE'); next; @@ -1983,7 +1998,7 @@ sub ndbcluster_wait_started($$){ mtr_init_args(\$args); mtr_add_arg($args, "--defaults-file=%s", $path_config_file); mtr_add_arg($args, "--defaults-group-suffix=%s", $cluster->suffix()); - mtr_add_arg($args, "--timeout=60"); + mtr_add_arg($args, "--timeout=%d", $opt_start_timeout); if ($ndb_waiter_extra_opt) { @@ -2600,7 +2615,6 @@ sub check_testcase($$) my $err_file= $proc->user_data(); my $base_file= mtr_match_extension($err_file, "err"); # Trim extension - unlink("$base_file.result"); # One check testcase process returned my $res= $proc->exit_status(); @@ -2611,6 +2625,11 @@ sub check_testcase($$) # Remove the .err file the check generated unlink($err_file); + # Remove the .result file the check generated + if ( $mode eq 'after' ){ + unlink("$base_file.result"); + } + if ( keys(%started) == 0){ # All checks completed return 0; @@ -2646,6 +2665,9 @@ sub check_testcase($$) # Remove the .err file the check generated unlink($err_file); + # Remove the .result file the check generated + unlink("$base_file.result"); + } } else {