]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
sg-report-flight: Report earlier, earlier step failures
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 10 Aug 2016 16:12:33 +0000 (17:12 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 11 Aug 2016 16:04:04 +0000 (17:04 +0100)
The order of results reported by sg-report-flight determines which
testid the bisector will try to work on first.  It also determines the
order in which failures are shown in the email reports.  We currently
sort them by the duration estimate (for each failure's containing job).

We should prefer earlier steps.  So change the first sort key to be
the duration estimate only for the steps leading up to the step of
interest for each failure.  (By passing the testid to the duration
estimator.)

Since the granularity is in seconds, this may still not distinguish
when there are fast steps.  So as a secondary sort criterion, use the
stepno.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
squash! sg-report-flight: Report earlier, earlier step failures

sg-report-flight

index d1acb608628b43eeae7ea2681d50af94eb3e5412..ca9ba18b53f1ddc9f207238321a42b2ece0d2cce 100755 (executable)
@@ -761,15 +761,29 @@ sub justifyfailures ($;$) {
 END
     $anypassq= db_prepare($anypassq);
 
-    my $duration_estimator= duration_estimator($branch, $blessings[0]);
+    my $duration_estimator=
+       duration_estimator($branch, $blessings[0], undef, 1);
     foreach my $failv (@failures) {
-        my ($est) = $duration_estimator->($failv->{Job}{job},'',undef);
+        my ($est) = $duration_estimator->($failv->{Job}{job},'',undef,
+                                        $failv->{Step}{testid});
         if (!defined $est) { $est = 1e5; }
         print DEBUG "DE $failv->{Job}{job} $est\n";
         $failv->{DurationEstimate}= $est;
     }
 
-    @failures= sort { $a->{DurationEstimate} <=> $b->{DurationEstimate} }
+    @failures= sort {
+       $a->{DurationEstimate} <=> $b->{DurationEstimate}
+       or $a->{Step}{stepno} <=> $b->{Step}{stepno}
+       # stepno is sequential only within each job, so strictly
+       # speaking this is not really a valid comparison: we will
+       # usually be comparing failed steps in different jobs.  But
+       # this comparison is a backstup, secondary to the duration
+       # estimate; and it does mean that if the two failures are
+       # different steps of the same job, and they ran fast so that
+       # they finished in the same second, we pick the lower-numbered
+       # step, which is the earlier one (if they are sequential at
+       # all).
+    }
         @failures;
 
     my @heisenflights;