Francois Gouget : testbot/bin: Fix the fatal error handling in WineRun{Build, Reconfig}.

Alexandre Julliard julliard at winehq.org
Wed Oct 31 13:40:50 CDT 2012


Module: tools
Branch: master
Commit: 0b786aab5fd2e3962da71c6182dd1b446699f20a
URL:    http://source.winehq.org/git/tools.git/?a=commit;h=0b786aab5fd2e3962da71c6182dd1b446699f20a

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Wed Oct 31 04:46:36 2012 +0100

testbot/bin: Fix the fatal error handling in WineRun{Build,Reconfig}.

Don't call TaskComplete() if we don't have a valid task to start with.
A failed task should have an error report file so create it first.

---

 testbot/bin/WineRunBuild.pl    |   21 ++++++++++-----------
 testbot/bin/WineRunReconfig.pl |   21 ++++++++++-----------
 2 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/testbot/bin/WineRunBuild.pl b/testbot/bin/WineRunBuild.pl
index cc0746f..e886801 100755
--- a/testbot/bin/WineRunBuild.pl
+++ b/testbot/bin/WineRunBuild.pl
@@ -45,6 +45,15 @@ sub FatalError
   my $TaskKey = defined($Task) ? $Task->GetKey() : "0";
 
   LogMsg "$JobKey/$StepKey/$TaskKey $ErrMessage";
+  if ($RptFileName)
+  {
+    my $RPTFILE;
+    if (open RPTFILE, ">>$RptFileName")
+    {
+      print RPTFILE $ErrMessage;
+      close RPTFILE;
+    }
+  }
 
   if ($Task)
   {
@@ -55,20 +64,10 @@ sub FatalError
 
     $Task->VM->Status('dirty');
     $Task->VM->Save();
-  }
 
-  if ($RptFileName)
-  {
-    my $RPTFILE;
-    if (open RPTFILE, ">>$RptFileName")
-    {
-      print RPTFILE $ErrMessage;
-      close RPTFILE;
-    }
+    TaskComplete($JobKey, $StepKey, $TaskKey);
   }
 
-  TaskComplete($JobKey, $StepKey, $TaskKey);
-
   exit 1;
 }
 
diff --git a/testbot/bin/WineRunReconfig.pl b/testbot/bin/WineRunReconfig.pl
index 9cc1e5e..c4d5c49 100755
--- a/testbot/bin/WineRunReconfig.pl
+++ b/testbot/bin/WineRunReconfig.pl
@@ -45,6 +45,15 @@ sub FatalError
   my $TaskKey = defined($Task) ? $Task->GetKey() : "0";
 
   LogMsg "$JobKey/$StepKey/$TaskKey $ErrMessage";
+  if ($RptFileName)
+  {
+    my $RPTFILE;
+    if (open RPTFILE, ">>$RptFileName")
+    {
+      print RPTFILE $ErrMessage;
+      close RPTFILE;
+    }
+  }
 
   if ($Task)
   {
@@ -55,20 +64,10 @@ sub FatalError
 
     $Task->VM->Status('dirty');
     $Task->VM->Save();
-  }
 
-  if ($RptFileName)
-  {
-    my $RPTFILE;
-    if (open RPTFILE, ">>$RptFileName")
-    {
-      print RPTFILE $ErrMessage;
-      close RPTFILE;
-    }
+    TaskComplete($JobKey, $StepKey, $TaskKey);
   }
 
-  TaskComplete($JobKey, $StepKey, $TaskKey);
-
   exit 1;
 }
 




More information about the wine-cvs mailing list