Report an unknown time if a change ahead has failed

We don't actually know how long it will take for a change to report
if a change ahead of it has failed (because this may need to be
restarted).  We could do a better job of estimating a minimum if
we had historic run-times of jobs internally, but we don't right
now, so at least let's say it's unknown for now.

Change-Id: I7a3e4d07a02893122564817f8119cb54632464f4
This commit is contained in:
James E. Blair 2013-07-25 15:03:01 -07:00
parent feeeaef950
commit 212f6127c3
1 changed files with 13 additions and 1 deletions

View File

@ -318,7 +318,19 @@ class Pipeline(object):
result=result,
voting=job.voting))
if self.haveAllJobsStarted(item):
ret['remaining_time'] = max_remaining
# if a change ahead has failed, we are unknown.
item_ahead_failed = False
i = item.item_ahead
while i:
if self.didAnyJobFail(i):
item_ahead_failed = True
i = None # safe to stop looking
else:
i = i.item_ahead
if item_ahead_failed:
ret['remaining_time'] = None
else:
ret['remaining_time'] = max_remaining
else:
ret['remaining_time'] = None
return ret