This helps identify transient errors, TestBot errors, or why a task is being re-run.
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- testbot/lib/WineTestBot/Activity.pm | 57 ++++++++++++++++++++++++++++++++++++- testbot/web/Activity.pl | 41 ++++++++++++++++++++++---- testbot/web/WineTestBot.css | 4 +++ 3 files changed, 95 insertions(+), 7 deletions(-)
diff --git a/testbot/lib/WineTestBot/Activity.pm b/testbot/lib/WineTestBot/Activity.pm index 31930ed2..d66109c0 100644 --- a/testbot/lib/WineTestBot/Activity.pm +++ b/testbot/lib/WineTestBot/Activity.pm @@ -66,6 +66,18 @@ describing the TestBot activity. The structure is as follows: ... }, }, + resultvms => { + <VMName1> => { + vm => <VMObject>, + result => <VMResult>, + tries => <Tries>, + maxtries => <MaxTries>, + details => <ResultDetails>, + }, + <VMName2> => { + ... + }, + }, }, <GroupNo2> => { ... @@ -134,11 +146,24 @@ sub GetActivity($) $VMStatus->{status} = $Status; $VMStatus->{rows} = 1;
+ $VMStatus->{result} = ""; if ($Status eq "running") { $VMStatus->{job} = $Jobs->GetItem($Extra[0]); $VMStatus->{step} = $VMStatus->{job}->Steps->GetItem($Extra[1]) if ($VMStatus->{job}); $VMStatus->{task} = $VMStatus->{step}->Tasks->GetItem($Extra[2]) if ($VMStatus->{step}); + if ($VMStatus->{task}) + { + if ($VMStatus->{task}->Status =~ /^(?:badpatch|badbuild|boterror)$/) + { + $VMStatus->{result} = $VMStatus->{task}->Status; + } + elsif ($VMStatus->{task}->Status eq "completed" and + $VMStatus->{task}->TestFailures) + { + $VMStatus->{result} = "failed"; + } + } } elsif (@Extra) { @@ -148,6 +173,24 @@ sub GetActivity($) $VMStatus->{details} = join(" ", @Extra); } } + elsif ($Record->Type eq "vmresult") + { + my ($RecordName, $RecordHost) = split / /, $Record->Name; + next if (!$VMs->ItemExists($RecordName)); + + my $ResultVMs = ( $Group->{resultvms} ||= {} ); + my $VMResult = ( $ResultVMs->{$RecordName} ||= {} ); + + $VMResult->{host} = $RecordHost; + my ($Result, @Extras) = split / /, $Record->Value; + $VMResult->{result} = $Result; + if (@Extras >= 2 and $Extras[0] =~ /^\d+$/ and $Extras[1] =~ /^\d+$/) + { + $VMResult->{tries} = shift @Extras; + $VMResult->{maxtries} = shift @Extras; + } + $VMResult->{details} = join(" ", @Extras); + } }
### Fill the holes in the table, compute end times, etc. @@ -157,7 +200,8 @@ sub GetActivity($) { my $Group = $Activity->{$RecordGroup->Id}; my $StatusVMs = $Group->{statusvms}; - next if (!$StatusVMs); + my $ResultVMs = $Group->{resultvms}; + next if (!$StatusVMs and !$ResultVMs); if ($LastGroup) { $LastGroup->{end} = $Group->{start}; @@ -175,6 +219,17 @@ sub GetActivity($) { my $LastVMStatus = $LastStatusVMs{$VM->Name} ? $LastStatusVMs{$VM->Name}->{$VM->Name} : undef;
+ my $VMResult = $ResultVMs->{$VM->Name}; + if ($VMResult and $LastVMStatus and $LastVMStatus->{status} ne "engine") + { + # Transfer the result to the relevant status object + $LastVMStatus->{result} = $VMResult->{result}; + $LastVMStatus->{details} = $VMResult->{details}; + $LastVMStatus->{tries} = $VMResult->{tries}; + $LastVMStatus->{maxtries} = $VMResult->{maxtries}; + } + next if (!$StatusVMs); + my $VMStatus = $StatusVMs->{$VM->Name}; if ($VMStatus) { diff --git a/testbot/web/Activity.pl b/testbot/web/Activity.pl index 64a752b5..5a730df4 100644 --- a/testbot/web/Activity.pl +++ b/testbot/web/Activity.pl @@ -160,11 +160,26 @@ EOF my $VMStatus = $Group->{statusvms}->{$VM->Name}; next if ($VMStatus->{merged});
- # Add borders to separate VM hosts and indicate anomalies. + # Add borders to separate VM hosts and indicate various 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); + if ($VMStatus->{result} eq "timeout") + { + print " Record-timeout"; + } + elsif ($VMStatus->{result} eq "boterror") + { + print " Record-boterror"; + } + elsif ($VMStatus->{result} eq "error") + { + print " Record-error"; + } + else + { + 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); @@ -215,6 +230,17 @@ EOF $Label = "<span class='RecordHost'>(on $Host)</span><br>$Label"; } print "$Label ", _GetHtmlDuration($VMStatus->{end} - $VMStatus->{start}); + + my $Result = ""; + if ($VMStatus->{status} ne "dirty") + { + $Result = $VMStatus->{result} if ($VMStatus->{result}); + $Result .= " $VMStatus->{tries}/$VMStatus->{maxtries}" if ($VMStatus->{tries}); + $Result .= ": $VMStatus->{details}" if ($VMStatus->{details}); + $Result =~ s/^: //; + } + print "<br><span class='RecordResult'>$Result</span>" if ($Result); + print "</td>\n"; } print "</tr>\n"; @@ -238,8 +264,11 @@ 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>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>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-running Record-timeout'>border</span> indicates that the task timed out,<br>\n"; + print "this <span class='Record Record-running Record-error'>border</span> denotes a transient (network?) error so the task will be re-run,<br>\n"; + print "and this <span class='Record Record-running Record-boterror'>border</span> indicates a TestBot error.<br>\n"; + print "Finally 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 55de9a33..4afbe31c 100644 --- a/testbot/web/WineTestBot.css +++ b/testbot/web/WineTestBot.css @@ -348,6 +348,7 @@ td.Record { text-align: center; } .RecordHost { font-size: smaller; } .RecordJob { font-size: smaller; } .RecordDuration { } +.RecordResult { font-size: smaller; font-style: italic; }
.Record-start { } .Record-off { color: #c0c0c0; } @@ -371,4 +372,7 @@ 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-boterror { border-left: thick solid red; border-right: thick solid red; } +.Record.Record-error { border-left: thick solid #990000; border-right: thick solid #990000; } +.Record.Record-timeout { border-left: thick solid blue; border-right: thick solid blue; } .Record.Record-miss { border-top: thick dashed #ff6600; }