Module: tools Branch: master Commit: 5683ae9206971084b0b6827f84d6c36ee196496d URL: https://gitlab.winehq.org/winehq/tools/-/commit/5683ae9206971084b0b6827f84d6...
Author: Francois Gouget fgouget@codeweavers.com Date: Thu Dec 8 18:44:16 2022 +0100
testbot/LogUtils: Fix counting of known new messages.
A given line can be matched by more than one known failure when it is too generic. This resulted in the eKnownNew counter being too high which then resulted in an invalid NewTestFailures value for the task. This patch ensures the *KnownNew counters count each line only once.
---
testbot/lib/WineTestBot/LogUtils.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/testbot/lib/WineTestBot/LogUtils.pm b/testbot/lib/WineTestBot/LogUtils.pm index 07b4dcf5..4a6aa72f 100644 --- a/testbot/lib/WineTestBot/LogUtils.pm +++ b/testbot/lib/WineTestBot/LogUtils.pm @@ -1538,6 +1538,8 @@ sub MatchLogFailures($$) my $NonFlakyLine = $Line; $NonFlakyLine =~ s/Test succeeded inside flaky todo block:/Test succeeded inside todo block:/g; $NonFlakyLine =~ s/Test marked flaky:/Test failed:/g; + + my $AddToKnownNew = $Group->{IsNew}->[$MsgIndex]; foreach my $UnitFailure (@$UnitFailures) { my $RegExp = $UnitFailure->FailureRegExp; @@ -1549,11 +1551,12 @@ sub MatchLogFailures($$)
my $LineFailures = $Group->{Failures}->{$MsgIndex} ||= []; push @$LineFailures, $UnitFailure->Id; - if ($Group->{IsNew}->[$MsgIndex]) + if ($AddToKnownNew) { my $Type = $Group->{Types}->[$MsgIndex]; $Group->{"${Type}KnownNew"}++; $LogInfo->{"${Type}KnownNew"}++; + $AddToKnownNew = undef; }
my $LogFailure = $LogFailures->{Failures}->{$UnitFailure->Id};