]> xenbits.xensource.com Git - people/aperard/osstest.git/commitdiff
duration_estimator: Ignore truncated jobs unless we know the step
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 21 Jul 2020 14:18:38 +0000 (15:18 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Thu, 6 Aug 2020 09:23:19 +0000 (10:23 +0100)
If we are looking for a particular step then we will ignore jobs
without that step, so any job which was truncated before it will be
ignored.

Otherwise we are looking for the whole job duration and a truncated
job is not a good representative.

This is a bugfix (to duration estimation), not a performance
improvement like the preceding and subsequent changes.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Osstest/Executive.pm

index 9208d8afe4b5b089049f76046b1b27f4898480dd..f528edd0addbef63cdba3345ee30e39de6c7c2b7 100644 (file)
@@ -1142,6 +1142,10 @@ sub duration_estimator ($$;$$) {
     # estimated (and only jobs which contained that step will be
     # considered).
 
+    my $or_status_truncated = '';
+    if ($will_uptoincl_testid) {
+       $or_status_truncated = "OR j.status='truncated'!";
+    }
     my $recentflights_q= $dbh_tests->prepare(<<END);
             SELECT f.flight AS flight,
                   f.started AS started,
@@ -1156,8 +1160,8 @@ sub duration_estimator ($$;$$) {
                       AND  f.branch=?
                       AND  j.job=?
                       AND  r.val=?
-                     AND  (j.status='pass' OR j.status='fail' OR
-                            j.status='truncated')
+                     AND  (j.status='pass' OR j.status='fail'
+                           $or_status_truncated)
                       AND  f.started IS NOT NULL
                       AND  f.started >= ?
                  ORDER BY f.started DESC