From 40ac968926f4aefbe0cab4cb971cf3fb512bb38f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 17 Oct 2006 10:31:06 +0200 Subject: [PATCH] Remove warnings Set comment properly before calling mtr_report_test failed and report_failure_restart mysql-test/lib/mtr_report.pl: Remove warnings No need to check ndb installed ok here, when that is detected comment is set to indicate the problem --- mysql-test/lib/mtr_report.pl | 7 +------ mysql-test/mysql-test-run.pl | 25 +++++++++++-------------- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl index b173896d48a..e92cac5cfba 100644 --- a/mysql-test/lib/mtr_report.pl +++ b/mysql-test/lib/mtr_report.pl @@ -130,16 +130,11 @@ sub mtr_report_test_failed ($) { my $tinfo= shift; $tinfo->{'result'}= 'MTR_RES_FAILED'; - if ( $tinfo->{'timeout'} ) + if ( defined $tinfo->{'timeout'} ) { print "[ fail ] timeout\n"; return; } - elsif ( $tinfo->{'ndb_test'} and $::cluster->[0]->{'installed_ok'} eq "NO") - { - print "[ fail ] ndbcluster start failure\n"; - return; - } else { print "[ fail ]\n"; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 5309e030c2c..1d217bdef84 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2755,10 +2755,9 @@ sub run_testcase_check_skip_test($) # If test needs this cluster, check it was installed ok if ( !$cluster->{'installed_ok'} ) { - mtr_tofile($path_timefile, - "Test marked as failed because $cluster->{'name'} " . - "was not installed ok!"); mtr_report_test_name($tinfo); + $tinfo->{comment}= + "Cluster $cluster->{'name'} was not installed ok"; mtr_report_test_failed($tinfo); return 1; } @@ -2881,10 +2880,8 @@ sub run_testcase ($) { # Can't restart a running server that may be in use if ( $glob_use_running_server ) { - $tinfo->{'skip'}= 1; - $tinfo->{'comment'}= "Can't restart a running server"; - mtr_report_test_name($tinfo); + $tinfo->{comment}= "Can't restart a running server"; mtr_report_test_skipped($tinfo); return; } @@ -2934,16 +2931,16 @@ sub run_testcase ($) { $tinfo->{'timeout'}= 1; # Mark as timeout report_failure_and_restart($tinfo); } + elsif ( $res == 1 ) + { + # Test case failure reported by mysqltest + report_failure_and_restart($tinfo); + } else { - # Test case failed, if in control mysqltest returns 1 - if ( $res != 1 ) - { - mtr_tofile($path_timefile, - "mysqltest returned unexpected code $res, " . - "it has probably crashed"); - } - + # mysqltest failed, probably crashed + $tinfo->{comment}= + "mysqltest returned unexpected code $res, it has probably crashed"; report_failure_and_restart($tinfo); }