Skip to content

Commit

Permalink
storage: fix failing system tests (#7714)
Browse files Browse the repository at this point in the history
* Add additional object deletion

* Add versions to list_blobs during deletion

* Fix retry call to empty bucket
  • Loading branch information
frankyn authored and crwilcox committed Apr 16, 2019
1 parent e24debe commit d8212f2
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions storage/tests/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,11 @@ def _bad_copy(bad_request):


def _empty_bucket(bucket):
"""Empty a bucket of all existing blobs.
This accounts (partially) for the eventual consistency of the
list blobs API call.
"""
for blob in bucket.list_blobs():
"""Empty a bucket of all existing blobs (including multiple versions)."""
for blob in bucket.list_blobs(versions=True):
try:
blob.delete()
except exceptions.NotFound: # eventual consistency
except exceptions.NotFound:
pass


Expand Down Expand Up @@ -87,6 +83,7 @@ def setUpModule():
def tearDownModule():
errors = (exceptions.Conflict, exceptions.TooManyRequests)
retry = RetryErrors(errors, max_tries=9)
retry(_empty_bucket)(Config.TEST_BUCKET)
retry(Config.TEST_BUCKET.delete)(force=True)


Expand Down

0 comments on commit d8212f2

Please sign in to comment.