Module: tools Branch: master Commit: 0b786aab5fd2e3962da71c6182dd1b446699f20a URL: http://source.winehq.org/git/tools.git/?a=commit;h=0b786aab5fd2e3962da71c618...
Author: Francois Gouget fgouget@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; }