From 212f6127c31e5f90955418eb414e56fcfcea367c Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Thu, 25 Jul 2013 15:03:01 -0700 Subject: [PATCH] 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 --- zuul/model.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/zuul/model.py b/zuul/model.py index 337e772f43..0f424352c8 100644 --- a/zuul/model.py +++ b/zuul/model.py @@ -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