From 29e8c154172bd6b9dccd9757fddace93be6ad194 Mon Sep 17 00:00:00 2001 From: Anel Husakovic Date: Mon, 3 May 2021 09:43:43 +0200 Subject: [PATCH] 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 --- .gitignore | 1 + mysql-test/mysql-test-run.pl | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/.gitignore b/.gitignore index 2cf801d6290..4de9edac44b 100644 --- a/.gitignore +++ b/.gitignore @@ -505,6 +505,7 @@ _UpgradeReport_Files/ Backup*/ UpgradeLog*.XML UpgradeLog*.htm +*.stackdump # SQL Server files *.mdf diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index fa68a017ff2..13369982daf 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -509,6 +509,12 @@ sub main { } if ( not @$completed ) { + my $test_name= mtr_grab_file($path_current_testlog); + $test_name =~ s/^CURRENT_TEST:\s//; + my $tinfo = My::Test->new(name => $test_name); + $tinfo->{result}= 'MTR_RES_FAILED'; + $tinfo->{logfile}=$path_current_testlog; + mtr_report_test($tinfo); mtr_error("Test suite aborted"); } @@ -5080,6 +5086,15 @@ sub mysqld_start ($$) { $opt_start_timeout, $mysqld->{'proc'}, $warn_seconds)) { my $mname= $mysqld->name(); + # Report failure about the last test case before exit + my $test_name= mtr_grab_file($path_current_testlog); + $test_name =~ s/^CURRENT_TEST:\s//; + my $tinfo = My::Test->new(name => $test_name); + $tinfo->{result}= 'MTR_RES_FAILED'; + $tinfo->{failures}= 1; + $tinfo->{logfile}=get_log_from_proc($mysqld->{'proc'}, $tinfo->{name}); + report_option('verbose', 1); + mtr_report_test($tinfo); mtr_error("Failed to start mysqld $mname with command $exe"); }