diff options
author | Bjorn Munch <Bjorn.Munch@sun.com> | 2009-12-15 10:12:24 +0100 |
---|---|---|
committer | Bjorn Munch <Bjorn.Munch@sun.com> | 2009-12-15 10:12:24 +0100 |
commit | 2fc4fbfd6b5cf11fe37fcec80085841b88d81145 (patch) | |
tree | 6dca5672885e8fd523875c254137f15e84014218 /mysql-test/mysql-test-run.pl | |
parent | 50ab925e046f197daa97057158fda532f6fe1c81 (diff) | |
download | mariadb-git-2fc4fbfd6b5cf11fe37fcec80085841b88d81145.tar.gz |
Bug #49672 mtr should extract end of result log if mysqltest fails without output
Extracts last 20 lines if no output after failure
Diffstat (limited to 'mysql-test/mysql-test-run.pl')
-rwxr-xr-x | mysql-test/mysql-test-run.pl | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 7d2426459d0..f0898e1cab7 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -3500,7 +3500,7 @@ sub run_testcase ($) { { # mysqltest failed, probably crashed $tinfo->{comment}= - "mysqltest failed with unexpected return code $res"; + "mysqltest failed with unexpected return code $res\n"; report_failure_and_restart($tinfo); } @@ -4091,6 +4091,19 @@ sub report_failure_and_restart ($) { # about what failed has been saved to file. Save the report # in tinfo $tinfo->{logfile}= mtr_fromfile($logfile); + # If no newlines in the test log: + if ($tinfo->{logfile} !~ /\n/) + { + # Show how far it got before suddenly failing + $tinfo->{comment}.= "mysqltest failed but provided no output\n"; + my $log_file_name= $opt_vardir."/log/".$tinfo->{shortname}.".log"; + if (-e $log_file_name) { + $tinfo->{comment}.= + "The result from queries just before the failure was:". + "\n< snip >\n". + mtr_lastlinesfromfile($log_file_name, 20)."\n"; + } + } } else { |