Francois Gouget : testbot/WineRunReconfig: Restart the TestAgent server if it was updated.
Alexandre Julliard
julliard at winehq.org
Fri Sep 27 12:48:56 CDT 2019
Module: tools
Branch: master
Commit: 54fe37c9538d3a30804aec4fcc47e94dded828a3
URL: https://source.winehq.org/git/tools.git/?a=commit;h=54fe37c9538d3a30804aec4fcc47e94dded828a3
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Fri Sep 27 13:04:27 2019 +0200
testbot/WineRunReconfig: Restart the TestAgent server if it was updated.
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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 0a5e606..edbafbc 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 9a45906..5014630 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;
}
More information about the wine-cvs
mailing list