Module: tools Branch: master Commit: 0d8799b58d9d22eaa4ee48c474d5fc7949b0f36a URL: https://source.winehq.org/git/tools.git/?a=commit;h=0d8799b58d9d22eaa4ee48c4...
Author: Francois Gouget fgouget@codeweavers.com Date: Thu Feb 8 12:09:53 2018 +0100
testbot: Fix the duration of some VM operations.
Sometimes a RecordGroup containing VM status information is followed by a RecordGroup containing only VM result information. This typically happens when a VM is running a task which ends in the 'boterror' state. However this VM result RecordGroup does not mean the VM is no longer in the 'running' state so it should not be used to set the previous group's 'end' time.
Signed-off-by: Francois Gouget fgouget@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
testbot/lib/WineTestBot/Activity.pm | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/testbot/lib/WineTestBot/Activity.pm b/testbot/lib/WineTestBot/Activity.pm index 5d8ee5f..c04a1e4 100644 --- a/testbot/lib/WineTestBot/Activity.pm +++ b/testbot/lib/WineTestBot/Activity.pm @@ -226,19 +226,25 @@ sub GetActivity($;$) { my $StatusVMs = $Group->{statusvms}; my $ResultVMs = $Group->{resultvms}; - next if (!$StatusVMs and !$ResultVMs); - if ($LastGroup) + if ($StatusVMs) { - $LastGroup->{end} = $Group->{start}; - foreach my $Counter ('runnable', 'queued') + if ($LastGroup) { - if (!exists $Group->{$Counter} and exists $LastGroup->{$Counter}) + $LastGroup->{end} = $Group->{start}; + foreach my $Counter ('runnable', 'queued') { - $Group->{$Counter} = $LastGroup->{$Counter}; + if (!exists $Group->{$Counter} and exists $LastGroup->{$Counter}) + { + $Group->{$Counter} = $LastGroup->{$Counter}; + } } } + $LastGroup = $Group; + } + elsif (!$ResultVMs) + { + next; } - $LastGroup = $Group;
foreach my $VM (@{$VMs->GetItems()}) {