[PATCH 3/3] testbot/web: Show the TestBot's mispredictions on the Activity page.

Francois Gouget fgouget at codeweavers.com
Thu Dec 21 18:46:09 CST 2017


The TestBot prepares VMs in advance so they are ready for the next Task.
Some times it mispredicts which VM will be needed next. Higlight such
cases on the Activity page so they can be identified and analyzed.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 testbot/lib/WineTestBot/Activity.pm | 10 ++++++++++
 testbot/web/Activity.pl             |  6 ++++--
 testbot/web/WineTestBot.css         |  1 +
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/testbot/lib/WineTestBot/Activity.pm b/testbot/lib/WineTestBot/Activity.pm
index 38cd556a..31930ed2 100644
--- a/testbot/lib/WineTestBot/Activity.pm
+++ b/testbot/lib/WineTestBot/Activity.pm
@@ -195,6 +195,16 @@ sub GetActivity($)
         $VMStatus->{vmstatus} = $VMStatus;
         weaken($VMStatus->{vmstatus}); # avoid memory cycles
       }
+      if ($LastVMStatus and $LastVMStatus->{status} ne $VMStatus->{status} and
+          # Ignore acts of administrator
+          $VMStatus->{status} !~ /^(?:maintenance|engine)$/ and
+          # And flag forbidden transitions
+          (($LastVMStatus->{status} eq "reverting" and $VMStatus->{status} ne "sleeping") or
+           ($LastVMStatus->{status} eq "sleeping" and $VMStatus->{status} !~ /^(?:idle|running)$/) or
+           ($LastVMStatus->{status} eq "idle" and $VMStatus->{status} ne "running")))
+      {
+        $LastVMStatus->{mispredict} = 1;
+      }
       $LastStatusVMs{$VM->Name} = $StatusVMs;
     }
   }
diff --git a/testbot/web/Activity.pl b/testbot/web/Activity.pl
index 35843533..378c1105 100644
--- a/testbot/web/Activity.pl
+++ b/testbot/web/Activity.pl
@@ -160,11 +160,12 @@ EOF
       my $VMStatus = $Group->{statusvms}->{$VM->Name};
       next if ($VMStatus->{merged});
 
-      # Add borders to separate VM hosts
+      # Add borders to separate VM hosts and indicate anomalies.
       print "<td class='Record Record-$VMStatus->{status}";
       my $Host = $VM->GetHost();
       print " Record-left" if ($Col > 0 and $SortedVMs[$Col-1]->GetHost() ne $Host);
       print " Record-right" if ($Col+1 < @SortedVMs and $SortedVMs[$Col+1]->GetHost() ne $Host);
+      print " Record-miss" if ($VMStatus->{mispredict});
       print "'";
       print " rowspan='$VMStatus->{rows}'" if ($VMStatus->{rows} > 1);
       print ">";
@@ -235,7 +236,8 @@ sub GenerateFooter($)
   print "<span class='Record-running'>running</span> a task (in which case it links to it),<br>\n";
   print "<span class='Record-dirty'>dirty</span> while the server is powering off the VM after a task or while it assesses its state on startup.</p>\n";
 
-  print "<p>If no time is indicated then the VM remained in that state for less than 2 seconds. The tasks column indicates the number of runnable / queued tasks before that scheduling round. A long horizontal bar indicates the TestBot server was restarted. </p>\n";
+  print "<p>If no time is indicated then the VM remained in that state for less than 2 seconds. The tasks column indicates the number of runnable / queued tasks before that scheduling round. A long horizontal bar indicates the TestBot server was restarted.</p>\n";
+  print "<p>This <span class='Record Record-idle Record-miss'>border</span> indicates that the server threw away the VM's current state without using it.</p>\n";
 
   print "<p>The VM could also be <span class='Record-offline'>offline</span> due to a temporary issue,<br>\n";
   print "or until the administrator can look at it for <span class='Record-maintenance'>maintenance</span>,<br>\n";
diff --git a/testbot/web/WineTestBot.css b/testbot/web/WineTestBot.css
index 80de5668..4d0548be 100644
--- a/testbot/web/WineTestBot.css
+++ b/testbot/web/WineTestBot.css
@@ -371,3 +371,4 @@ td.Record { text-align: center; }
 /* Special borders */
 .Record.Record-left { border-left: thin solid #601919; }
 .Record.Record-right { border-right: thin solid #601919; }
+.Record.Record-miss { border-top: thick dashed #ff6600; }
-- 
2.15.1



More information about the wine-devel mailing list