Skip to content

Commit

Permalink
works
Browse files Browse the repository at this point in the history
  • Loading branch information
Wauplin committed Oct 12, 2023
1 parent 49f042b commit 5b6c8c7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,12 @@ def retry_on_transient_error(fn: CallableT) -> CallableT:
@wraps(fn)
def _inner(*args, **kwargs):
retry_count = 0
while retry_count < NUMBER_OF_TRIES:
while True:
try:
return fn(*args, **kwargs)
except HTTPError as e:
if retry_count >= NUMBER_OF_TRIES:
raise
if e.response.status_code == 504:
logger.info(
f"Attempt {retry_count} failed with a 504 error. Retrying new execution in"
Expand All @@ -107,6 +109,8 @@ def _inner(*args, **kwargs):
else:
raise
except OSError:
if retry_count >= NUMBER_OF_TRIES:
raise
logger.info(
"Race condition met where we tried to `clone` before fully deleting a repository. Retrying new"
f" execution in {WAIT_TIME} second(s)..."
Expand Down

0 comments on commit 5b6c8c7

Please sign in to comment.