Skip to content

Commit 29e8c15

Browse files
committed
MDEV-25857: MTR should report at least last test that was executed in case of shutdown and not-completed
- Report the test name in case not all tests are completed and server closed the connection - Rerport the failure of the last test with the server log in case of server shutdown. - Ignore stackdump files (obtained on Windows). Reviewed by: wlad@mariadb.com
1 parent 8b02e02 commit 29e8c15

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,7 @@ _UpgradeReport_Files/
505505
Backup*/
506506
UpgradeLog*.XML
507507
UpgradeLog*.htm
508+
*.stackdump
508509

509510
# SQL Server files
510511
*.mdf

mysql-test/mysql-test-run.pl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,12 @@ sub main {
509509
}
510510

511511
if ( not @$completed ) {
512+
my $test_name= mtr_grab_file($path_current_testlog);
513+
$test_name =~ s/^CURRENT_TEST:\s//;
514+
my $tinfo = My::Test->new(name => $test_name);
515+
$tinfo->{result}= 'MTR_RES_FAILED';
516+
$tinfo->{logfile}=$path_current_testlog;
517+
mtr_report_test($tinfo);
512518
mtr_error("Test suite aborted");
513519
}
514520

@@ -5080,6 +5086,15 @@ ($$)
50805086
$opt_start_timeout, $mysqld->{'proc'}, $warn_seconds))
50815087
{
50825088
my $mname= $mysqld->name();
5089+
# Report failure about the last test case before exit
5090+
my $test_name= mtr_grab_file($path_current_testlog);
5091+
$test_name =~ s/^CURRENT_TEST:\s//;
5092+
my $tinfo = My::Test->new(name => $test_name);
5093+
$tinfo->{result}= 'MTR_RES_FAILED';
5094+
$tinfo->{failures}= 1;
5095+
$tinfo->{logfile}=get_log_from_proc($mysqld->{'proc'}, $tinfo->{name});
5096+
report_option('verbose', 1);
5097+
mtr_report_test($tinfo);
50835098
mtr_error("Failed to start mysqld $mname with command $exe");
50845099
}
50855100

0 commit comments

Comments
 (0)