Module: tools
Branch: master
Commit: 129508e7e60130f979b6715db00114d5100011a4
URL: https://source.winehq.org/git/tools.git/?a=commit;h=129508e7e60130f979b6715…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Mon May 14 13:21:30 2018 +0200
testbot: Requeue the task in case the script gets stuck.
Count how many times the task has been requeued to avoid infinite loops,
just like the scripts themselves normally do.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/lib/WineTestBot/Tasks.pm | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/testbot/lib/WineTestBot/Tasks.pm b/testbot/lib/WineTestBot/Tasks.pm
index 72dd3ff..36cbfad 100644
--- a/testbot/lib/WineTestBot/Tasks.pm
+++ b/testbot/lib/WineTestBot/Tasks.pm
@@ -165,11 +165,25 @@ sub UpdateStatus($$)
close TASKLOG;
}
umask($OldUMask);
- # This probably indicates a bug in the task script.
- # Don't requeue the task to avoid an infinite loop.
+
require WineTestBot::Log;
WineTestBot::Log::LogMsg("Child process for task $JobId/$StepNo/$TaskNo died unexpectedly\n");
- $self->Status("boterror");
+
+ # A crash probably indicates a bug in the task script but getting stuck
+ # could happen due to network issues. So requeue the task like its script
+ # would and count attempts to avoid getting into an infinite loop.
+ if ($self->CanRetry())
+ {
+ $Status = "queued";
+ $self->TestFailures(($self->TestFailures || 0) + 1);
+ $self->Started(undef);
+ $self->Ended(undef);
+ }
+ else
+ {
+ $Status = "boterror";
+ }
+ $self->Status($Status);
$self->Save();
if ($VM->Status eq "running")
@@ -181,8 +195,6 @@ sub UpdateStatus($$)
$VM->RecordResult(undef, "boterror process died");
}
# else it looks like this is not our VM anymore
-
- $Status = "boterror";
}
elsif ($Skip && $Status eq "queued")
{