Skip to content

Commit

Permalink
Retry harder in face of 409/429 during module teardown. (#8113)
Browse files Browse the repository at this point in the history
Closes #7505.
  • Loading branch information
tseaver authored May 24, 2019
1 parent 42e8e37 commit a7932de
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions storage/tests/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def _bad_copy(bad_request):

def _empty_bucket(bucket):
"""Empty a bucket of all existing blobs (including multiple versions)."""
for blob in bucket.list_blobs(versions=True):
for blob in list(bucket.list_blobs(versions=True)):
try:
blob.delete()
except exceptions.NotFound:
Expand Down Expand Up @@ -83,9 +83,8 @@ def setUpModule():


def tearDownModule():
_empty_bucket(Config.TEST_BUCKET)
errors = (exceptions.Conflict, exceptions.TooManyRequests)
retry = RetryErrors(errors, max_tries=9)
retry = RetryErrors(errors, max_tries=15)
retry(_empty_bucket)(Config.TEST_BUCKET)
retry(Config.TEST_BUCKET.delete)(force=True)

Expand Down

0 comments on commit a7932de

Please sign in to comment.