Signed-off-by: Francois Gouget fgouget@codeweavers.com --- testbot/bin/WineRunReconfig.pl | 20 ++++++++++++++++++++ testbot/lib/Build/Utils.pm | 9 ++++++--- 2 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/testbot/bin/WineRunReconfig.pl b/testbot/bin/WineRunReconfig.pl index ddb2208e2..606027182 100755 --- a/testbot/bin/WineRunReconfig.pl +++ b/testbot/bin/WineRunReconfig.pl @@ -487,6 +487,26 @@ if ($NewStatus eq "completed") FatalTAError($TA, "An error occurred while retrieving '$TaskDir/$BaseName'"); } } + + if ($Summary->{"testagentd"}) + { + # Restart the TestAgent server from the new binary + # Note that the privileged TestAgent server is usually run with + # --set-time-only which means it cannot be upgraded since the restart RPC + # is blacklisted. But that also means it's unlikely to need upgrading. + Debug(Elapsed($Start), " Upgrading testagentd from ". $TA->GetVersion() ."\n"); + $TA->Restart(undef); + # Give the server enough time to restart, thus (maybe) avoiding a timeout + # on the first (re)connection attempt. + sleep(1); + my $Version = $TA->GetVersion(); + if (!$Version) + { + my $ErrMessage = $TA->GetLastError(); + FatalError("Could not connect to the new ". $VM->Name ." TestAgent: $ErrMessage\n"); + } + Debug(Elapsed($Start), "Upgraded testagentd to $Version\n"); + } }
$TA->Disconnect(); diff --git a/testbot/lib/Build/Utils.pm b/testbot/lib/Build/Utils.pm index 9a4590677..50146301a 100644 --- a/testbot/lib/Build/Utils.pm +++ b/testbot/lib/Build/Utils.pm @@ -196,9 +196,8 @@ sub GetCPUCount()
sub BuildNativeTestAgentd() { - # If testagentd already exists it's likely already running - # so don't rebuild it. - return 1 if (-x "$BinDir/build/testagentd"); + my $NativeTestAgentd = "$::RootDir/bin/build/testagentd"; + my $Before = GetMTime($NativeTestAgentd);
InfoMsg "\nBuilding the native testagentd\n"; my $CPUCount = GetCPUCount(); @@ -210,6 +209,10 @@ sub BuildNativeTestAgentd() return !1; }
+ if ($Before != GetMTime($NativeTestAgentd)) + { + LogMsg "Updated testagentd\n"; + } return 1; }