Commit 4dacafc1 authored by unknown's avatar unknown

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:
  Use "failures" to keep track of if test has previously failed
parent cec9696f
......@@ -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);
......
......@@ -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 {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment