Skip to content

Commit

Permalink
Make sure that CJI timeout results in exit (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsquizz authored Oct 14, 2021
1 parent 5f52d90 commit a66fc41
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bonfire/openshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ def _check_with_periodic_log(self):
self._time_last_logged = time.time()
return False

def wait_for_ready(self, timeout):
def wait_for_ready(self, timeout, reraise=False):
self._time_last_logged = time.time()
self._time_remaining = timeout

Expand All @@ -439,8 +439,12 @@ def wait_for_ready(self, timeout):
return True
except (StatusError, ErrorReturnCode) as err:
log.error("[%s] hit error waiting for resource to be ready: %s", self.key, str(err))
if reraise:
raise
except (TimeoutException, TimedOutError):
log.error("[%s] timed out waiting for resource to be ready", self.key)
if reraise:
raise
return False


Expand Down Expand Up @@ -728,7 +732,7 @@ def _pod_found():
remaining_time = remaining_time - elapsed

waiter = ResourceWaiter(namespace, "pod", pod_name)
waiter.wait_for_ready(remaining_time)
waiter.wait_for_ready(remaining_time, reraise=True)

return pod_name

Expand Down

0 comments on commit a66fc41

Please sign in to comment.