Commit f7791cc7 authored by Daniel Black's avatar Daniel Black

Revert "MDEV-30186 Use of uninitialized value in substitution"

This reverts commit 0e737f78.

As noted by Andrew, this introduces race conditions in the setting
and using of the global $test_name_for_report.
parent 27ff972b
...@@ -145,7 +145,6 @@ my $opt_start_exit; ...@@ -145,7 +145,6 @@ my $opt_start_exit;
my $start_only; my $start_only;
my $file_wsrep_provider; my $file_wsrep_provider;
my $num_saved_cores= 0; # Number of core files saved in vardir/log/ so far. my $num_saved_cores= 0; # Number of core files saved in vardir/log/ so far.
my $test_name_for_report;
our @global_suppressions; our @global_suppressions;
...@@ -516,13 +515,13 @@ sub main { ...@@ -516,13 +515,13 @@ sub main {
} }
if ( not @$completed ) { if ( not @$completed ) {
if ($test_name_for_report) my $test_name= mtr_grab_file($path_testlog);
{ $test_name =~ s/^CURRENT_TEST:\s//;
my $tinfo = My::Test->new(name => $test_name_for_report); chomp($test_name);
$tinfo->{result}= 'MTR_RES_FAILED'; my $tinfo = My::Test->new(name => $test_name);
$tinfo->{comment}=' '; $tinfo->{result}= 'MTR_RES_FAILED';
mtr_report_test($tinfo); $tinfo->{comment}=' ';
} mtr_report_test($tinfo);
mtr_error("Test suite aborted"); mtr_error("Test suite aborted");
} }
...@@ -3741,8 +3740,8 @@ sub resfile_report_test ($) { ...@@ -3741,8 +3740,8 @@ sub resfile_report_test ($) {
sub run_testcase ($$) { sub run_testcase ($$) {
my ($tinfo, $server_socket)= @_; my ($tinfo, $server_socket)= @_;
my $print_freq=20; my $print_freq=20;
$test_name_for_report= $tinfo->{name};
mtr_verbose("Running test:", $test_name_for_report); mtr_verbose("Running test:", $tinfo->{name});
$ENV{'MTR_TEST_NAME'} = $tinfo->{name}; $ENV{'MTR_TEST_NAME'} = $tinfo->{name};
resfile_report_test($tinfo) if $opt_resfile; resfile_report_test($tinfo) if $opt_resfile;
...@@ -5131,10 +5130,12 @@ sub mysqld_start ($$) { ...@@ -5131,10 +5130,12 @@ sub mysqld_start ($$) {
if (!$rc) if (!$rc)
{ {
# Report failure about the last test case before exit # Report failure about the last test case before exit
my $tinfo = My::Test->new(name => $test_name_for_report); 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->{result}= 'MTR_RES_FAILED';
$tinfo->{failures}= 1; $tinfo->{failures}= 1;
$tinfo->{logfile}=get_log_from_proc($mysqld->{'proc'}, $test_name_for_report); $tinfo->{logfile}=get_log_from_proc($mysqld->{'proc'}, $tinfo->{name});
report_option('verbose', 1); report_option('verbose', 1);
mtr_report_test($tinfo); mtr_report_test($tinfo);
} }
......
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