[PATCH] testbot: Make sure UpdateStatus() iterates over all the Steps and Tasks.

Francois Gouget fgouget at codeweavers.com
Tue Jun 12 04:49:23 CDT 2018


It tends to be called from places where filters have been put on the
Steps and/or Tasks collections which prevents it from getting the full
picture. So work on a clone that has no filter.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 testbot/lib/WineTestBot/Jobs.pm  | 2 +-
 testbot/lib/WineTestBot/Steps.pm | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/testbot/lib/WineTestBot/Jobs.pm b/testbot/lib/WineTestBot/Jobs.pm
index b3512e1f2..a13b3468e 100644
--- a/testbot/lib/WineTestBot/Jobs.pm
+++ b/testbot/lib/WineTestBot/Jobs.pm
@@ -209,7 +209,7 @@ sub UpdateStatus($)
   return $Status if ($Status ne "queued" && $Status ne "running");
 
   my %Has;
-  my $Steps = $self->Steps;
+  my $Steps = $self->Steps->Clone();
   my @SortedSteps = sort { $a->No <=> $b->No } @{$Steps->GetItems()};
   foreach my $Step (@SortedSteps)
   {
diff --git a/testbot/lib/WineTestBot/Steps.pm b/testbot/lib/WineTestBot/Steps.pm
index aea1aee04..8afe79396 100644
--- a/testbot/lib/WineTestBot/Steps.pm
+++ b/testbot/lib/WineTestBot/Steps.pm
@@ -199,7 +199,7 @@ sub UpdateStatus($$)
   return $Status if ($Status ne "queued" && $Status ne "running");
 
   my %Has;
-  map { $Has{$_->UpdateStatus($Skip)} = 1 } (@{$self->Tasks->GetItems()});
+  map { $Has{$_->UpdateStatus($Skip)} = 1 } (@{$self->Tasks->Clone()->GetItems()});
 
   # Inherit the tasks most significant status.
   # Note that one or more tasks may have been requeued during the cleanup phase
-- 
2.17.1




More information about the wine-devel mailing list