diff options
author | Rasmus Johansson <razze@iki.fi> | 2020-05-19 09:10:24 +0000 |
---|---|---|
committer | Rasmus Johansson <razze@iki.fi> | 2020-05-19 10:43:22 +0000 |
commit | a4735453cac53a2c0e442fbd5c3dfc67ba78329c (patch) | |
tree | d38214be67922cf18fbeaf4b05a92b76d1bc4d9b | |
parent | 44c8d84908e9d697bbcea55d6ebcd5f2250c4727 (diff) | |
download | mariadb-git-10.1-MDEV-22273.tar.gz |
MDEV-22631 some test causes MTR interruption without generating summary and XML10.1-MDEV-22273
-rw-r--r-- | mysql-test/lib/mtr_report.pm | 4 | ||||
-rwxr-xr-x | mysql-test/mysql-test-run.pl | 10 |
2 files changed, 11 insertions, 3 deletions
diff --git a/mysql-test/lib/mtr_report.pm b/mysql-test/lib/mtr_report.pm index 0b99eafa4cf..d228e9406e0 100644 --- a/mysql-test/lib/mtr_report.pm +++ b/mysql-test/lib/mtr_report.pm @@ -473,7 +473,7 @@ sub mtr_report_stats ($$$$) { $comment =~ s/[\"]//g; # if a test case has to be retried it should have the result MTR_RES_FAILED in jUnit XML - if ($test->{'result'} eq "MTR_RES_FAILED" || $test->{'retries'}) { + if ($test->{'result'} eq "MTR_RES_FAILED" || $test->{'retries'} > 0) { my $logcontents = $test->{'logfile-failed'} || $test->{'logfile'}; $xml_report .= qq(>\n\t\t\t<failure message="" type="MTR_RES_FAILED">\n<![CDATA[$logcontents]]>\n\t\t\t</failure>\n\t\t</testcase>\n); @@ -639,6 +639,8 @@ sub mtr_error (@) { } else { + use Carp qw(cluck); + cluck "Error happened" if $verbose > 0; exit(1); } } diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 538b76677f4..cd376690461 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -769,8 +769,14 @@ sub run_test_server ($$$) { if ( $result->is_failed() ) { my $worker_logdir= $result->{savedir}; my $log_file_name=dirname($worker_logdir)."/".$result->{shortname}.".log"; - $result->{'logfile-failed'} = mtr_lastlinesfromfile($log_file_name, 20); - rename $log_file_name,$log_file_name.".failed"; + + if (-e $log_file_name) { + $result->{'logfile-failed'} = mtr_lastlinesfromfile($log_file_name, 20); + } else { + $result->{'logfile-failed'} = ""; + } + + rename $log_file_name, $log_file_name.".failed"; } delete($result->{result}); $result->{retries}= $retries+1; |