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>
# 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,
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