[tools] testbot/LogUtils: Don't include garbage in the .errors file.

Francois Gouget fgouget at codeweavers.com
Mon Mar 22 05:12:15 CDT 2021


When failure lines are garbled because of a race condition or a missing
'\n' they often contain unwanted characters at the start of the line.
If included in the .errors file these prevent the line from matching
past instances of the failure (if only because of line numbers), thus
causing it to be incorrectly reported as new. So only include the
parts of the line matched by the error matching regular expression.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50491
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
There are some performance implications for using things like $& and $' 
but that's only for old Perl versions, older than is used on the 
TestBot. Furthermore nowadays we only parse reports when a task 
completes, not every time we present the results on the website.

For the following wtbsuite test:
WTBS Garbled trace, ok, todo, skip sampler (advpack:advpack).
---
 testbot/lib/WineTestBot/LogUtils.pm    | 8 ++++----
 testbot/src/reporttest/report.testwtbs | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/testbot/lib/WineTestBot/LogUtils.pm b/testbot/lib/WineTestBot/LogUtils.pm
index 840a5526a..903afe495 100644
--- a/testbot/lib/WineTestBot/LogUtils.pm
+++ b/testbot/lib/WineTestBot/LogUtils.pm
@@ -573,7 +573,7 @@ sub ParseWineTestReport($$$)
            $Line =~ /^([_a-z0-9]+)\.c:\d+:[0-9.]* Test (?:failed|succeeded inside todo block): /)
     {
       _CheckUnit($LogInfo, $Cur, $1, "failure");
-      _AddReportError($LogInfo, $Cur, $LineNo, $Line);
+      _AddReportError($LogInfo, $Cur, $LineNo, "$&$'");
       $Cur->{LineFailures}++;
     }
     elsif (($Cur->{Unit} ne "" and
@@ -625,7 +625,7 @@ sub ParseWineTestReport($$$)
           $Cur->{Pids}->{$Pid || 0} = 1;
           $Cur->{SummaryFailures}++;
         }
-        _AddReportError($LogInfo, $Cur, $LineNo, $Line);
+        _AddReportError($LogInfo, $Cur, $LineNo, "$&$'");
         $Cur->{LineFailures}++;
       }
     }
@@ -636,7 +636,7 @@ sub ParseWineTestReport($$$)
         # This also replaces a test summary line. The pid is unknown so use 0.
         $Cur->{Pids}->{0} = 1;
         $Cur->{SummaryFailures}++;
-        _AddReportError($LogInfo, $Cur, $LineNo, $Line);
+        _AddReportError($LogInfo, $Cur, $LineNo, "$&$'");
         $Cur->{LineFailures}++;
       }
     }
@@ -654,7 +654,7 @@ sub ParseWineTestReport($$$)
           $Cur->{Pids}->{$Pid || 0} = 1;
           $Cur->{SummaryFailures}++;
         }
-        _AddReportError($LogInfo, $Cur, $LineNo, $Line);
+        _AddReportError($LogInfo, $Cur, $LineNo, $&);
         $Cur->{LineFailures}++;
       }
     }
diff --git a/testbot/src/reporttest/report.testwtbs b/testbot/src/reporttest/report.testwtbs
index e1988278c..104c8ea60 100644
--- a/testbot/src/reporttest/report.testwtbs
+++ b/testbot/src/reporttest/report.testwtbs
@@ -50,11 +50,11 @@ n 0 comboex.c:40: Test failed: A failure in the main process
 n 0 comboex.c:41: Test succeeded inside todo block: Success in the main process
 n 0 header.c:1: Test failed: Something wrong
 n 0 1234:rebar: unhandled exception c0000005 at 0040167C
-n 0 garbled0123:status: unhandled exception c0000005 at 0040167C
-n 0 status.c:33: unhandled exception c0000005 in child process 0123dead
+n 0 0123:status: unhandled exception c0000005 at 0040167C
+n 0 status.c:33: unhandled exception c0000005 in child process 0123
 n 0 1234:subclass: unhandled exception c0000005 at 0040167C
-n 0 Do not cut syslink.c:40: Test failed: Something wrong
-n 0 Do not cut syslink.c:41: Test succeeded inside todo block: Something right!
+n 0 syslink.c:40: Test failed: Something wrong
+n 0 syslink.c:41: Test succeeded inside todo block: Something right!
 n 0 Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x0054376d).
 n 0 1234:taskdialog: unhandled exception c0000005 at 0040167C
 n 0 taskdialog.c:471: unhandled exception c0000005 in child process 1234
-- 
2.20.1



More information about the wine-devel mailing list