Francois Gouget : testbot: Fail test units that spam the test report.

Alexandre Julliard julliard at winehq.org
Tue Feb 27 10:46:18 CST 2018


Module: tools
Branch: master
Commit: afc41c0fdcf87692f34cad61b1d9d5538dd89b26
URL:    https://source.winehq.org/git/tools.git/?a=commit;h=afc41c0fdcf87692f34cad61b1d9d5538dd89b26

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Tue Feb 27 02:43:45 2018 +0100

testbot: Fail test units that spam the test report.

To not exceed the maximum report size, each test unit must print less
than 2.5KB of traces on average. So report tests that hog more than
10 times that.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 testbot/bin/WineRunTask.pl        | 8 ++++++++
 testbot/lib/WineTestBot/Config.pm | 6 ++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/testbot/bin/WineRunTask.pl b/testbot/bin/WineRunTask.pl
index 65faf72..46b11f3 100755
--- a/testbot/bin/WineRunTask.pl
+++ b/testbot/bin/WineRunTask.pl
@@ -511,6 +511,7 @@ if ($TA->GetFile($RptFileName, $FullLogFileName))
     # track of the current one. Note that for the TestBot we don't count or
     # complain about misplaced skips.
     my ($CurrentDll, $CurrentUnit) = ("", "");
+    my $UnitSize = 0;
     my ($LineFailures, $LineTodos, $LineSkips) = (0, 0, 0);
     my ($SummaryFailures, $SummaryTodos, $SummarySkips) = (0, 0, 0);
     my ($CurrentIsBroken, %CurrentPids, $CurrentRc, $LogFailures);
@@ -564,6 +565,11 @@ if ($TA->GetFile($RptFileName, $FullLogFileName))
       # so only use them as a fallback.
       $LineFailures ||= $SummaryFailures;
 
+      if ($UnitSize > $MaxUnitSize)
+      {
+        LogTaskError("$CurrentDll:$CurrentUnit prints too much data ($UnitSize bytes)\n");
+        $LogFailures++;
+      }
       if (!$CurrentIsBroken and defined $CurrentRc)
       {
         # Check the exit code, particularly against failures reported
@@ -601,6 +607,7 @@ if ($TA->GetFile($RptFileName, $FullLogFileName))
       $LogFailures += $LineFailures;
 
       $CurrentDll = $CurrentUnit = "";
+      $UnitSize = 0;
       $LineFailures = $LineTodos = $LineSkips = 0;
       $SummaryFailures = $SummaryTodos = $SummarySkips = 0;
       $CurrentIsBroken = 0;
@@ -610,6 +617,7 @@ if ($TA->GetFile($RptFileName, $FullLogFileName))
 
     foreach my $Line (<$LogFile>)
     {
+      $UnitSize += length($Line);
       if ($Line =~ m%^([_.a-z0-9-]+):([_a-z0-9]*) (start|skipped) (?:-|[/_.a-z0-9]+) (?:-|[.0-9a-f]+)\r?$%)
       {
         my ($Dll, $Unit, $Type) = ($1, $2, $3);
diff --git a/testbot/lib/WineTestBot/Config.pm b/testbot/lib/WineTestBot/Config.pm
index 02c9dac..9052fc4 100644
--- a/testbot/lib/WineTestBot/Config.pm
+++ b/testbot/lib/WineTestBot/Config.pm
@@ -32,7 +32,7 @@ use vars qw (@ISA @EXPORT @EXPORT_OK $UseSSL $LogDir $DataDir $BinDir
              $SleepAfterRevert $WaitForToolsInVM $MaxTaskTries $AdminEMail
              $RobotEMail
              $WinePatchToOverride $WinePatchCc $SuiteTimeout $SingleTimeout
-             $BuildTimeout $ReconfigTimeout $TagPrefix
+             $BuildTimeout $ReconfigTimeout $TagPrefix $MaxUnitSize
              $ProjectName $PatchesMailingList $LDAPServer
              $LDAPBindDN $LDAPSearchBase $LDAPSearchFilter
              $LDAPRealNameAttribute $LDAPEMailAttribute $AgentPort $Tunnel
@@ -47,7 +47,7 @@ require Exporter;
              $MaxTaskTries $AdminEMail
              $RobotEMail $WinePatchToOverride $WinePatchCc $SuiteTimeout
              $SingleTimeout $BuildTimeout $ReconfigTimeout
-             $TagPrefix $ProjectName $PatchesMailingList
+             $TagPrefix $MaxUnitSize $ProjectName $PatchesMailingList
              $LDAPServer $LDAPBindDN $LDAPSearchBase $LDAPSearchFilter
              $LDAPRealNameAttribute $LDAPEMailAttribute $AgentPort $Tunnel
              $TunnelDefaults $PrettyHostNames $JobPurgeDays $JobArchiveDays
@@ -96,6 +96,8 @@ $BuildTimeout = 5 * 60;
 # How long to let a full recompilation run before forcibly shutting it down
 # (in seconds).
 $ReconfigTimeout = 45 * 60;
+# Maximum amount of traces for a test unit.
+$MaxUnitSize = 32 * 1024;
 
 $ProjectName = "Wine";
 $PatchesMailingList = "wine-devel";




More information about the wine-cvs mailing list