[PATCH 4/4] testbot/Engine: Only reschedule if we got a completed patch set.

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


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

diff --git a/testbot/bin/Engine.pl b/testbot/bin/Engine.pl
index 177578209..730fd42e2 100755
--- a/testbot/bin/Engine.pl
+++ b/testbot/bin/Engine.pl
@@ -638,15 +638,16 @@ checks whether any pending patchsets are now complete and thus can be scheduled.
 sub SafetyNet()
 {
   CheckJobs();
+  ScheduleJobs();
   HandleWinePatchWebSubmission();
 
   my $Set = CreatePendingPatchSets();
-  my $ErrMessage = $Set->CheckForCompleteSet();
-  if (defined($ErrMessage))
+  my ($Submitted, $ErrMessage) = $Set->CheckForCompleteSet();
+  if (defined $ErrMessage)
   {
     LogMsg "Failed to check completeness of patch series: $ErrMessage\n";
   }
-  ScheduleJobs();
+  ScheduleJobs() if ($Submitted);
 }
 
 sub PrepareSocket($)
diff --git a/testbot/lib/WineTestBot/PendingPatchSets.pm b/testbot/lib/WineTestBot/PendingPatchSets.pm
index c0dc56fbe..bfd05e4a3 100644
--- a/testbot/lib/WineTestBot/PendingPatchSets.pm
+++ b/testbot/lib/WineTestBot/PendingPatchSets.pm
@@ -94,7 +94,7 @@ sub CheckComplete($)
 =item C<SubmitSubset()>
 
 Combines the patches leading to the specified part in the patchset, and then
-calls WineTestBot::Patch::Submit() so it gets scheduled for testing.
+calls WineTestBot::Patch::Submit() to create the corresponding job.
 
 =back
 =cut
@@ -307,29 +307,27 @@ sub CheckForCompleteSet($)
 {
   my ($self) = @_;
 
-  my $ErrMessage;
+  my ($Submitted, @ErrMessages);
   foreach my $Set (@{$self->GetItems()})
   {
     if ($Set->CheckComplete())
     {
       my $Patch = $Set->Parts->GetItem($Set->TotalParts)->Patch;
       my $SetErrMessage = $Set->Submit($Patch);
-      if (defined($SetErrMessage))
+      if (defined $SetErrMessage)
       {
-        if (! defined($ErrMessage))
-        {
-          $ErrMessage = $SetErrMessage;
-        }
+        push @ErrMessages, $SetErrMessage;
       }
       else
       {
         $Patch->Save();
+        $Submitted = 1;
       }
       $self->DeleteItem($Set);
     }
   }
 
-  return $ErrMessage;
+  return ($Submitted, @ErrMessages ? join("; ", @ErrMessages) : undef);
 }
 
 1;
-- 
2.17.0



More information about the wine-devel mailing list