Module: tools Branch: master Commit: 735fa7e2f8c2a45022e28daf0d7977ebce33ba26 URL: http://source.winehq.org/git/tools.git/?a=commit;h=735fa7e2f8c2a45022e28daf0...
Author: Francois Gouget fgouget@codeweavers.com Date: Fri Mar 29 14:04:00 2013 +0100
testbot/WineRunTask: Nest the timeouts so each of them is correctly detected.
---
testbot/bin/WineRunTask.pl | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/testbot/bin/WineRunTask.pl b/testbot/bin/WineRunTask.pl index 903fbbe..991e143 100755 --- a/testbot/bin/WineRunTask.pl +++ b/testbot/bin/WineRunTask.pl @@ -251,6 +251,8 @@ if (!$TA->SendFile("$BinDir/windows/$TestLauncher", $TestLauncher, 0)) FatalError "Can't copy TestLauncher to VM: $ErrMessage\n", $FullErrFileName, $Job, $Step, $Task; } + +my $Timeout = $Task->Timeout; my $Script = "@echo off\r\nset WINETEST_DEBUG=" . $Step->DebugLevel . "\r\n"; if ($Step->ReportSuccessfulTests) @@ -259,7 +261,10 @@ if ($Step->ReportSuccessfulTests) } if ($Step->Type eq "single") { - $Script .= "$TestLauncher -t " . $Task->Timeout . " $FileName "; + $Script .= "$TestLauncher -t $Timeout $FileName "; + # Add 1 second to the timeout so the client-side Wait() does not time out + # right before $TestLauncher does. + $Timeout += 1; my $CmdLineArg = $Task->CmdLineArg; if ($CmdLineArg) { @@ -307,7 +312,7 @@ if (!$TA->SendFileFromString($Script, "script.bat", $TestAgent::SENDFILE_EXE)) }
my $Pid = $TA->Run(["./script.bat"], 0); -if (!$Pid or !defined $TA->Wait($Pid, $Task->Timeout)) +if (!$Pid or !defined $TA->Wait($Pid, $Timeout)) { $ErrMessage = $TA->GetLastError(); }