Merge "Delay initialization of local repos"
diff --git a/setup.cfg b/setup.cfg
index caa15d6..242a2c3 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -16,6 +16,9 @@
     Programming Language :: Python :: 2.7
     Programming Language :: Python :: 2.6
 
+[pbr]
+warnerrors = True
+
 [global]
 setup-hooks =
     pbr.hooks.setup_hook
diff --git a/zuul/model.py b/zuul/model.py
index 337e772..0f42435 100644
--- a/zuul/model.py
+++ b/zuul/model.py
@@ -318,7 +318,19 @@
                     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