[PATCH 2/3] testbot: Fix the duration of some VM operations.

Francois Gouget fgouget at codeweavers.com
Thu Feb 8 05:09:53 CST 2018


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 at codeweavers.com>
---
 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 5d8ee5f2a..c04a1e437 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()})
     {
-- 
2.15.1




More information about the wine-devel mailing list