[tools 2/2] testbot/Engine: Also handle notifications originating from the Engine.

Francois Gouget fgouget at codeweavers.com
Thu Jun 16 10:15:26 CDT 2022


In particular notifications of job status changes must be processed in
order for the result emails to be sent and for the patch status to be
updated.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
I believe this explains why a number of developer emails were getting 
lost during some tests I ran. I had suspected ISP-level spam filtering 
issues, or too big emails, but I recently noticed cases where 
WineSendLog was not getting called which turned out to be because of 
this issue.
---
 testbot/bin/Engine.pl                    |  2 +-
 testbot/lib/WineTestBot/Engine/Notify.pm | 16 ++++++++++++----
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/testbot/bin/Engine.pl b/testbot/bin/Engine.pl
index 29dce183b..9d836529c 100755
--- a/testbot/bin/Engine.pl
+++ b/testbot/bin/Engine.pl
@@ -751,7 +751,7 @@ sub main()
   $SIG{CHLD} = \&REAPER;
   WineTestBot::Log::SetupRedirects();
 
-  $WineTestBot::Engine::Notify::RunningInEngine = 1;
+  SetNotificationHandler(\&HandleClientCmd);
   LogMsg "Starting the WineTestBot Engine\n";
 
   # Validate and adjust the configuration options
diff --git a/testbot/lib/WineTestBot/Engine/Notify.pm b/testbot/lib/WineTestBot/Engine/Notify.pm
index 9c1802984..c9930e6e6 100644
--- a/testbot/lib/WineTestBot/Engine/Notify.pm
+++ b/testbot/lib/WineTestBot/Engine/Notify.pm
@@ -2,6 +2,7 @@
 # Notification of WineTestBot engine
 #
 # Copyright 2009 Ge van Geldorp
+# Copyright 2012-2022 Francois Gouget
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -29,8 +30,8 @@ WineTestBot::Engine::Notify - Engine notification
 
 use Exporter 'import';
 our $RunningInEngine;
-our @EXPORT = qw(Shutdown PingEngine JobStatusChange JobControl
-                 RescheduleJobs VMStatusChange
+our @EXPORT = qw(SetNotificationHandlerShutdown PingEngine JobStatusChange
+                 JobControl RescheduleJobs VMStatusChange
                  WinePatchMLSubmission WinePatchWebSubmission
                  UpdateFailure GetScreenshot);
 our @EXPORT_OK = qw($RunningInEngine);
@@ -38,14 +39,21 @@ our @EXPORT_OK = qw($RunningInEngine);
 use Socket;
 use WineTestBot::Config;
 
+my $_CmdHandler;
+
+sub SetNotificationHandler($)
+{
+  my ($Handler) = @_;
+  $_CmdHandler = $Handler;
+}
 
 sub SendCmdReceiveReply($)
 {
   my ($Cmd) = @_;
 
-  if (defined($RunningInEngine))
+  if ($_CmdHandler)
   {
-    return "1";
+    return &$_CmdHandler(split ' ', $Cmd);
   }
 
   if (! socket(SOCK, PF_UNIX, SOCK_STREAM, 0))
-- 
2.30.2



More information about the wine-devel mailing list