[PATCH 1/4] testbot: Scheduling jobs is the Engine's responsibility.

Francois Gouget fgouget at codeweavers.com
Sun May 6 18:57:36 CDT 2018


It already does not make sense to call ScheduleJobs() in other 
processes. So only call it from Engine.pl.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 testbot/bin/Engine.pl              | 6 +++++-
 testbot/lib/WineTestBot/Patches.pm | 7 ++-----
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/testbot/bin/Engine.pl b/testbot/bin/Engine.pl
index 3d1f2c1e5..b61db8871 100755
--- a/testbot/bin/Engine.pl
+++ b/testbot/bin/Engine.pl
@@ -448,6 +448,8 @@ sub HandleWinePatchMLSubmission()
     my $ErrMessage = CreatePatches()->NewPatch($Entity);
     push @ErrMessages, $ErrMessage if (defined $ErrMessage);
 
+    ScheduleJobs();
+
     # Clean up
     if (!rmtree($WorkDir))
     {
@@ -520,6 +522,8 @@ sub HandleWinePatchWebSubmission()
     my $ErrMessage = $Patches->NewPatch($Entity, $WebPatchId);
     push @ErrMessages, $ErrMessage if (defined $ErrMessage);
 
+    ScheduleJobs();
+
     # Clean up
     if (!rmtree($WorkDir))
     {
@@ -621,7 +625,6 @@ checks whether any pending patchsets are now complete and thus can be scheduled.
 sub SafetyNet()
 {
   CheckJobs();
-  ScheduleJobs();
   HandleWinePatchWebSubmission();
 
   my $Set = CreatePendingPatchSets();
@@ -630,6 +633,7 @@ sub SafetyNet()
   {
     LogMsg "Failed to check completeness of patch series: $ErrMessage\n";
   }
+  ScheduleJobs();
 }
 
 sub PrepareSocket($)
diff --git a/testbot/lib/WineTestBot/Patches.pm b/testbot/lib/WineTestBot/Patches.pm
index 5edeab06e..26127e93a 100644
--- a/testbot/lib/WineTestBot/Patches.pm
+++ b/testbot/lib/WineTestBot/Patches.pm
@@ -147,8 +147,8 @@ sub GetTestList()
 Analyzes the current patch to determine which Wine tests are impacted. Then for
 each impacted test it creates a high priority WineTestBot::Job to run that test.
 This also creates the WineTestBot::Step objects for that Job, as well as the
-WineTestBot::Task objects to run the test on each 'base' VM. Finally it calls
-C<WineTestBot::Jobs::ScheduleJobs()> to run the new Jobs.
+WineTestBot::Task objects to run the test on each 'base' VM. It is the
+responsibility of the caller to arrange for rescheduling of the jobs.
 
 Note that the path to the file containing the actual patch is passed as a
 parameter. This is used to apply a combined patch for patch series. See
@@ -341,9 +341,6 @@ sub Submit($$$)
     $Disposition .= $NewJob->Id;
   }
   $self->Disposition($Disposition);
-
-  ScheduleJobs();
-
   return undef;
 }
 
-- 
2.17.0




More information about the wine-devel mailing list