From 62a9731533f3a609d8bf4a317a1e7516bfa36803 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Wed, 21 Jun 2023 12:43:48 -0700 Subject: [PATCH] runtests: use more consistent failure lines After a test failure log a consistent log message to make it easier to parse the log file. Also, log a consistent message with "ignored" for failures that cause the test to be not considered at all. These should perhaps be counted in the skipped category, but this commit does not change that behaviour. --- tests/runner.pm | 12 ++++++------ tests/runtests.pl | 7 +++++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/tests/runner.pm b/tests/runner.pm index 813c669890..abab866543 100644 --- a/tests/runner.pm +++ b/tests/runner.pm @@ -515,7 +515,7 @@ sub torture { } } if($fail) { - logmsg " Failed on function number $limit in test.\n", + logmsg " $testnum: torture FAILED: function number $limit in test.\n", " invoke with \"-t$limit\" to repeat this single case.\n"; stopservers($verbose); return 1; @@ -712,7 +712,7 @@ sub singletest_prepare { my $filename=$fileattr{'name'}; if(@inputfile || $filename) { if(!$filename) { - logmsg "ERROR: section client=>file has no name attribute\n"; + logmsg " $testnum: IGNORED: section client=>file has no name attribute\n"; return -1; } my $fileContent = join('', @inputfile); @@ -846,14 +846,14 @@ sub singletest_run { } if(! -f $CMDLINE) { - logmsg "The tool set in the test case for this: '$tool' does not exist\n"; + logmsg " $testnum: IGNORED: The tool set in the test case for this: '$tool' does not exist\n"; return (-1, 0, 0, "", "", 0); } $DBGCURL=$CMDLINE; } if($fail_due_event_based) { - logmsg "This test cannot run event based\n"; + logmsg " $testnum: IGNORED: This test cannot run event based\n"; return (-1, 0, 0, "", "", 0); } @@ -1026,7 +1026,7 @@ sub singletest_clean { foreach my $server (@killtestservers) { chomp $server; if(stopserver($server)) { - logmsg " killserver FAILED\n"; + logmsg " $testnum: killserver FAILED\n"; return 1; # normal error if asked to fail on unexpected alive } } @@ -1050,7 +1050,7 @@ sub singletest_postcheck { # Must run the postcheck command in torture mode in order # to clean up, but the result can't be relied upon. if($rc != 0 && !$torture) { - logmsg " postcheck FAILED\n"; + logmsg " $testnum: postcheck FAILED\n"; return -1; } } diff --git a/tests/runtests.pl b/tests/runtests.pl index 31483890f1..7626912a54 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -1504,13 +1504,16 @@ sub singletest_check { my $filename=$hash{'name'}; if(!$filename) { - logmsg "ERROR: section verify=>file$partsuffix ". + logmsg " $testnum: IGNORED: section verify=>file$partsuffix ". "has no name attribute\n"; if (runnerac_stopservers($runnerid)) { logmsg "ERROR: runner $runnerid seems to have died\n"; } else { # TODO: this is a blocking call that will stall the controller, + if($verbose) { + logmsg "WARNING: blocking call in async function\n"; + } # but this error condition should never happen except during # development. my ($rid, $unexpected, $logs) = runnerar($runnerid); @@ -1596,7 +1599,7 @@ sub singletest_check { logmsg sprintf("\n%s returned $cmdres, when expecting %s\n", (!$tool)?"curl":$tool, $errorcode); } - logmsg " exit FAILED\n"; + logmsg " $testnum: exit FAILED\n"; # timestamp test result verification end $timevrfyend{$testnum} = Time::HiRes::time(); return -1;