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@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