Skip to content

Commit

Permalink
MDEV-22631 some test causes MTR interruption without generating summa…
Browse files Browse the repository at this point in the history
…ry and XML
  • Loading branch information
rasmushoj committed May 19, 2020
1 parent 44c8d84 commit e9a33a5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion mysql-test/lib/mtr_report.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -639,6 +639,8 @@ sub mtr_error (@) {
}
else
{
use Carp qw(cluck);
cluck "Error happened" if $verbose > 0;
exit(1);
}
}
Expand Down
10 changes: 8 additions & 2 deletions mysql-test/mysql-test-run.pl
Original file line number Diff line number Diff line change
Expand Up @@ -769,8 +769,14 @@ ($$$)
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;
Expand Down

0 comments on commit e9a33a5

Please sign in to comment.