Francois Gouget : testbot/LogUtils: Improve the pid detection on garbled lines.
Alexandre Julliard
julliard at winehq.org
Mon Mar 15 16:58:03 CDT 2021
Module: tools
Branch: master
Commit: 77f52c9e4acadd74d3ae05087511b1ec9771c04e
URL: https://source.winehq.org/git/tools.git/?a=commit;h=77f52c9e4acadd74d3ae05087511b1ec9771c04e
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Mon Mar 15 10:30:18 2021 +0100
testbot/LogUtils: Improve the pid detection on garbled lines.
The pid is always printed with a fixed width so this should be taken
into account to avoid matching too much. For instance in
'garbage1234:unit.c:...' one should match '1234', not 'e1234' which
would lead to a mismatch with the pids on other lines.
This is particularly important for the exception, summary and done
lines.
This also means the matching can be simplified a bit since we know
where the relevant part of the line starts.
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
testbot/lib/WineTestBot/LogUtils.pm | 25 ++++++++++---------------
1 file changed, 10 insertions(+), 15 deletions(-)
diff --git a/testbot/lib/WineTestBot/LogUtils.pm b/testbot/lib/WineTestBot/LogUtils.pm
index e93eac0..eced000 100644
--- a/testbot/lib/WineTestBot/LogUtils.pm
+++ b/testbot/lib/WineTestBot/LogUtils.pm
@@ -321,7 +321,7 @@ sub GetReportLineCategory($)
if ($Line =~ /:[0-9.]* Tests skipped: / or
$Line =~ /^[_.a-z0-9-]+:[_a-z0-9]* skipped / or
$Line =~ /^[_.a-z0-9-]+:\d+:[0-9.]* Line has been silenced after \d+ occurrences$/ or
- $Line =~ /^[0-9a-f]+:[_a-z0-9]+:[0-9.]* Silenced \d+ todos, \d+ skips and \d+ traces\.$/)
+ $Line =~ /^[0-9a-f]{4}:[_a-z0-9]+:[0-9.]* Silenced \d+ todos, \d+ skips and \d+ traces\.$/)
{
return "skip";
}
@@ -459,7 +459,7 @@ sub _AddReportError($$$$)
# Make the timeout messages more user-friendly
my $ErrLine = $Line;
- if ($ErrLine =~ /^[^:]+:([^:]*):[0-9a-f]+ done \(258\)/)
+ if ($ErrLine =~ /^[^:]+:([^:]*):[0-9a-f]{4} done \(258\)/)
{
my $Unit = $1;
$ErrLine = $Unit ne "" ? "$Unit: Timeout" : "Timeout";
@@ -611,9 +611,7 @@ sub ParseWineTestReport($$$)
_CheckUnit($LogInfo, $Cur, $Unit, "ignore exceptions");
$Cur->{IgnoreExceptions} = $Ignore;
}
- elsif (($Cur->{Unit} ne "" and
- $Line =~ /([0-9a-f]+):($Cur->{UnitsRE}):[0-9.]* unhandled exception [0-9a-fA-F]{8} at /) or
- $Line =~ /^([0-9a-f]+):([_.a-z0-9]+):[0-9.]* unhandled exception [0-9a-fA-F]{8} at /)
+ elsif ($Line =~ /([0-9a-f]{4}):([_.a-z0-9]+):[0-9.]* unhandled exception [0-9a-fA-F]{8} at /)
{
my ($Pid, $Unit) = ($1, $2);
_CheckUnit($LogInfo, $Cur, $Unit, "unhandled exception");
@@ -641,8 +639,8 @@ sub ParseWineTestReport($$$)
}
}
elsif (($Cur->{Unit} ne "" and
- $Line =~ /($Cur->{UnitsRE})\.c:\d+:[0-9.]* unhandled exception [0-9a-fA-F]{8} in child process ([0-9a-f]+)/) or
- $Line =~ /^([_.a-z0-9]+)\.c:\d+:[0-9.]* unhandled exception [0-9a-fA-F]{8} in child process ([0-9a-f]+)/)
+ $Line =~ /($Cur->{UnitsRE})\.c:\d+:[0-9.]* unhandled exception [0-9a-fA-F]{8} in child process ([0-9a-f]{4})/) or
+ $Line =~ /^([_.a-z0-9]+)\.c:\d+:[0-9.]* unhandled exception [0-9a-fA-F]{8} in child process ([0-9a-f]{4})/)
{
my ($Unit, $Pid) = ($1, $2);
_CheckUnit($LogInfo, $Cur, $Unit, "child exception");
@@ -658,9 +656,7 @@ sub ParseWineTestReport($$$)
$Cur->{LineFailures}++;
}
}
- elsif (($Cur->{Unit} ne "" and
- $Line =~ /([0-9a-f]+):($Cur->{Unit}):[0-9.]* \d+ tests? executed \((\d+) marked as todo, (\d+) failures?\), (\d+) skipped\./) or
- $Line =~ /^([0-9a-f]+):([_a-z0-9]+):[0-9.]* \d+ tests? executed \((\d+) marked as todo, (\d+) failures?\), (\d+) skipped\./)
+ elsif ($Line =~ /([0-9a-f]{4}):([_a-z0-9]+):[0-9.]* \d+ tests? executed \((\d+) marked as todo, (\d+) failures?\), (\d+) skipped\./)
{
my ($Pid, $Unit, $Todos, $Failures, $Skips) = ($1, $2, $3, $4, $5);
@@ -681,8 +677,8 @@ sub ParseWineTestReport($$$)
}
}
elsif (($Cur->{Dll} ne "" and
- $Line =~ /(\Q$Cur->{Dll}\E):([_a-z0-9]*):([0-9a-f]+) done \((-?\d+)\) in /) or
- $Line =~ /^([_.a-z0-9-]+):([_a-z0-9]*):([0-9a-f]+) done \((-?\d+)\) in /)
+ $Line =~ /(\Q$Cur->{Dll}\E):([_a-z0-9]*):([0-9a-f]{4}) done \((-?\d+)\) in /) or
+ $Line =~ /^([_.a-z0-9-]+):([_a-z0-9]*):([0-9a-f]{4}) done \((-?\d+)\) in /)
{
my ($Dll, $Unit, $Pid, $Rc) = ($1, $2, $3, $4);
@@ -1149,10 +1145,9 @@ sub _GetLineKey($)
# Remove the crash code address: it changes whenever the test is recompiled
or $Line =~ s/^(Unhandled exception: .* code) \(0x[0-9a-fA-F]{8,16}\)\.$/$1/
# or the process id in Wine's exc_filter() lines
- or $Line =~ s/^[0-9a-f]+:([_a-z0-9]+:)[0-9.]*( unhandled exception [0-9a-fA-F]{8} at )[0-9a-fA-F]{8,16}$/$1$2/
+ or $Line =~ s/[0-9a-f]{4}:([_a-z0-9]+:)[0-9.]*( unhandled exception [0-9a-fA-F]{8} at )[0-9a-fA-F]{8,16}$/$1$2/
# or child process id
- or $Line =~ s/^([_a-z0-9]+\.c:)\d+:[0-9.]*( unhandled exception [0-9a-fA-F]{8} in child process )[0-9a-fA-F]{4}$/$1$2/
-
+ or $Line =~ s/^([_a-z0-9]+\.c:)\d+:[0-9.]*( unhandled exception [0-9a-fA-F]{8} in child process )[0-9a-f]{4}/$1$2/
# The exact amount of data printed does not change the error
or $Line =~ s/^([_.a-z0-9-]+:[_a-z0-9]* prints too much data )\(\d+ bytes\)$/$1/;
More information about the wine-cvs
mailing list