Francois Gouget : testbot/WineRun*: Account for any task.log error.

Alexandre Julliard julliard at winehq.org
Thu Apr 8 16:02:42 CDT 2021


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

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Thu Apr  8 12:38:26 2021 +0200

testbot/WineRun*: Account for any task.log error.

This ensures TestLauncher errors are accounted for in the task result.
Builds are not expected to generate errors in task.log but if they do,
they too should be accounted for.

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

---

 testbot/bin/WineRunBuild.pl    |  9 ++++++---
 testbot/bin/WineRunReconfig.pl | 10 +++++++---
 testbot/bin/WineRunTask.pl     |  1 +
 testbot/bin/WineRunWineTest.pl | 11 ++++++++---
 4 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/testbot/bin/WineRunBuild.pl b/testbot/bin/WineRunBuild.pl
index 13f488b..8585882 100755
--- a/testbot/bin/WineRunBuild.pl
+++ b/testbot/bin/WineRunBuild.pl
@@ -385,7 +385,7 @@ if (!$Pid)
 # log before giving up
 #
 
-my ($NewStatus, $ErrMessage, $TAError, $TaskTimedOut);
+my ($NewStatus, $ErrMessage, $TaskFailures, $TaskTimedOut, $TAError);
 Debug(Elapsed($Start), " Waiting for the script (", $Task->Timeout, "s timeout)\n");
 if (!defined $TA->Wait($Pid, $Task->Timeout, 60))
 {
@@ -407,12 +407,15 @@ Debug(Elapsed($Start), " Retrieving 'Build.log'\n");
 if ($TA->GetFile("Build.log", "$TaskDir/task.log"))
 {
   my $LogInfo = ParseTaskLog("$TaskDir/task.log");
+  $TaskFailures ||= $LogInfo->{ErrCount};
   if ($LogInfo->{Task} eq "ok")
   {
     # We must have gotten the full log and the build did succeed.
-    # So forget any prior error.
+    # So forget any prior error...
     $NewStatus = "completed";
     $TAError = $ErrMessage = undef;
+    # ...but keep keep the task.log ones
+    $TaskFailures = $LogInfo->{ErrCount};
   }
   elsif ($LogInfo->{Task} eq "badpatch")
   {
@@ -489,4 +492,4 @@ $TA->Disconnect();
 # Wrap up
 #
 
-WrapUpAndExit($NewStatus, undef, undef, $TaskTimedOut);
+WrapUpAndExit($NewStatus, $TaskFailures, undef, $TaskTimedOut);
diff --git a/testbot/bin/WineRunReconfig.pl b/testbot/bin/WineRunReconfig.pl
index ec82849..9bd9429 100755
--- a/testbot/bin/WineRunReconfig.pl
+++ b/testbot/bin/WineRunReconfig.pl
@@ -385,7 +385,7 @@ if (!$Pid)
 # log before giving up
 #
 
-my ($NewStatus, $ErrMessage, $TAError, $TaskTimedOut);
+my ($NewStatus, $ErrMessage, $TaskFailures, $TaskTimedOut, $TAError);
 Debug(Elapsed($Start), " Waiting for the script (", $Task->Timeout, "s timeout)\n");
 if (!defined $TA->Wait($Pid, $Task->Timeout, 60))
 {
@@ -394,6 +394,7 @@ if (!defined $TA->Wait($Pid, $Task->Timeout, 60))
   {
     $ErrMessage = "The build timed out\n";
     $NewStatus = "badbuild";
+    $TaskFailures = 1;
     $TaskTimedOut = 1;
   }
   else
@@ -408,12 +409,15 @@ Debug(Elapsed($Start), " Retrieving 'Reconfig.log'\n");
 if ($TA->GetFile("Reconfig.log", "$TaskDir/task.log"))
 {
   $LogInfo = ParseTaskLog("$TaskDir/task.log");
+  $TaskFailures ||= $LogInfo->{ErrCount};
   if ($LogInfo->{Task} eq "ok")
   {
     # We must have gotten the full log and the build did succeed.
-    # So forget any prior error.
+    # So forget any prior error...
     $NewStatus = "completed";
     $TAError = $ErrMessage = undef;
+    # ...but keep keep the task.log ones
+    $TaskFailures = $LogInfo->{ErrCount};
   }
   elsif (defined $LogInfo->{BadLog})
   {
@@ -566,4 +570,4 @@ if ($NewStatus eq 'completed')
 # In case of a regular build failure retrying is pointless. But in case of a
 # timeout the VM host may be less busy next time and since the snapshot is
 # unchanged we can retry.
-WrapUpAndExit($NewStatus, undef, $TaskTimedOut, $TaskTimedOut);
+WrapUpAndExit($NewStatus, $TaskFailures, $TaskTimedOut, $TaskTimedOut);
diff --git a/testbot/bin/WineRunTask.pl b/testbot/bin/WineRunTask.pl
index b1578ad..db274b4 100755
--- a/testbot/bin/WineRunTask.pl
+++ b/testbot/bin/WineRunTask.pl
@@ -534,6 +534,7 @@ Debug(Elapsed($Start), " Retrieving 'Task.log'\n");
 if ($TA->GetFile("Task.log", "$TaskDir/task.log"))
 {
   my $LogInfo = ParseTaskLog("$TaskDir/task.log");
+  $TaskFailures ||= $LogInfo->{ErrCount};
   my $ErrMessage = CreateLogErrorsCache($LogInfo);
   LogTaskError("$ErrMessage\n") if (defined $ErrMessage);
 }
diff --git a/testbot/bin/WineRunWineTest.pl b/testbot/bin/WineRunWineTest.pl
index 3a267ac..c9a57bb 100755
--- a/testbot/bin/WineRunWineTest.pl
+++ b/testbot/bin/WineRunWineTest.pl
@@ -508,19 +508,24 @@ Debug(Elapsed($Start), " Retrieving 'Task.log'\n");
 if ($TA->GetFile("Task.log", "$TaskDir/task.log"))
 {
   my $LogInfo = ParseTaskLog("$TaskDir/task.log");
+  $TaskFailures ||= $LogInfo->{ErrCount};
   if ($LogInfo->{Task} eq "ok")
   {
     # We must have gotten the full log and the task completed successfully
     # (with or without test failures). So clear any previous errors, including
     # $TaskFailures since there was not really a timeout after all.
     $NewStatus = "completed";
-    $TaskFailures = $TAError = $ErrMessage = $PossibleCrash = undef;
+    $TAError = $ErrMessage = $PossibleCrash = undef;
+    # Reset the timeout error but keep the task.log ones
+    $TaskFailures = $LogInfo->{ErrCount};
   }
   elsif ($LogInfo->{Task} eq "badpatch")
   {
     # This too is conclusive enough to ignore other errors.
     $NewStatus = "badpatch";
-    $TaskFailures = $TAError = $ErrMessage = $PossibleCrash = undef;
+    $TAError = $ErrMessage = $PossibleCrash = undef;
+    # Reset the timeout error but keep the keep the task.log ones
+    $TaskFailures = $LogInfo->{ErrCount};
   }
   elsif (defined $LogInfo->{BadLog})
   {
@@ -532,7 +537,7 @@ if ($TA->GetFile("Task.log", "$TaskDir/task.log"))
     $NewStatus = "badbuild";
     $TaskFailures = $PossibleCrash = undef;
   }
-  elsif (!$TaskTimedOut and !defined $TAError)
+  elsif (!$TaskTimedOut and !defined $TAError and !$LogInfo->{ErrCount})
   {
     # Did WineTest.pl crash?
     $NewStatus = "boterror";




More information about the wine-cvs mailing list