Module: tools Branch: master Commit: 19620e33e61a30429d509c30412db4c0ddcb43d7 URL: https://source.winehq.org/git/tools.git/?a=commit;h=19620e33e61a30429d509c30... Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Mon May 7 01:57:49 2018 +0200 testbot/Engine: Only reschedule if we got a completed patch set. Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- 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 1775782..730fd42 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 c0dc56f..bfd05e4 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;