[2/2] testbot: Use a keepalive to detect when the tasks crashed their VM and network outages.

Francois Gouget fgouget at codeweavers.com
Tue Mar 11 05:48:20 CDT 2014


---

This makes use of the infrastructure of patch 1 in the scripts that run 
the WineTestBot tasks. Given that regular tests have a 2 minutes timeout 
we use a shorter keepalive for them.

 testbot/bin/WineRunBuild.pl    | 2 +-
 testbot/bin/WineRunReconfig.pl | 2 +-
 testbot/bin/WineRunTask.pl     | 5 ++++-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/testbot/bin/WineRunBuild.pl b/testbot/bin/WineRunBuild.pl
index 98a9211..e8561c9 100755
--- a/testbot/bin/WineRunBuild.pl
+++ b/testbot/bin/WineRunBuild.pl
@@ -254,7 +254,7 @@ if (!$TA->SendFileFromString($Script, "task", $TestAgent::SENDFILE_EXE))
              $FullErrFileName, $Job, $Task;
 }
 my $Pid = $TA->Run(["./task"], 0);
-if (!$Pid or !defined $TA->Wait($Pid, $Task->Timeout))
+if (!$Pid or !defined $TA->Wait($Pid, $Task->Timeout, 60))
 {
   $ErrMessage = $TA->GetLastError();
   # Try to grab the build log before reporting the failure
diff --git a/testbot/bin/WineRunReconfig.pl b/testbot/bin/WineRunReconfig.pl
index 0728a0b..562b9d1 100755
--- a/testbot/bin/WineRunReconfig.pl
+++ b/testbot/bin/WineRunReconfig.pl
@@ -220,7 +220,7 @@ if (!$TA->SendFileFromString($Script, "task", $TestAgent::SENDFILE_EXE))
              $FullErrFileName, $Job, $Task;
 }
 my $Pid = $TA->Run(["./task"], 0);
-if (!$Pid or !defined $TA->Wait($Pid, $Task->Timeout))
+if (!$Pid or !defined $TA->Wait($Pid, $Task->Timeout, 60))
 {
   $ErrMessage = $TA->GetLastError();
   # Try to grab the reconfig log before reporting the failure
diff --git a/testbot/bin/WineRunTask.pl b/testbot/bin/WineRunTask.pl
index 3b5c17e..ce1adb5 100755
--- a/testbot/bin/WineRunTask.pl
+++ b/testbot/bin/WineRunTask.pl
@@ -257,6 +257,7 @@ if (!$TA->SendFile("$BinDir/windows/$TestLauncher", $TestLauncher, 0))
              $FullErrFileName, $Job, $Step, $Task;
 }
 
+my $Keepalive;
 my $Timeout = $Task->Timeout;
 my $Script = "\@echo off\r\nset WINETEST_DEBUG=" . $Step->DebugLevel .
              "\r\n";
@@ -270,6 +271,7 @@ if ($Step->Type eq "single")
   # Add 1 second to the timeout so the client-side Wait() does not time out
   # right before $TestLauncher does.
   $Timeout += 1;
+  $Keepalive = 20;
   my $CmdLineArg = $Task->CmdLineArg;
   if ($CmdLineArg)
   {
@@ -279,6 +281,7 @@ if ($Step->Type eq "single")
 }
 elsif ($Step->Type eq "suite")
 {
+  $Keepalive = 60;
   $Script .= "$FileName ";
   my $Tag = lc($TagPrefix) . "-" . lc($VM->Name);
   $Tag =~ s/[^a-zA-Z0-9]/-/g;
@@ -317,7 +320,7 @@ if (!$TA->SendFileFromString($Script, "script.bat", $TestAgent::SENDFILE_EXE))
 }
 
 my $Pid = $TA->Run(["./script.bat"], 0);
-if (!$Pid or !defined $TA->Wait($Pid, $Timeout))
+if (!$Pid or !defined $TA->Wait($Pid, $Timeout, $Keepalive))
 {
   $ErrMessage = "Failure running script in VM: " . $TA->GetLastError();
 }
-- 
1.8.5.3



More information about the wine-patches mailing list