Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storage: harden teardown in system tests. #6444

Merged
merged 1 commit into from
Nov 7, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions storage/tests/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,13 @@ def setUp(self):
self.case_blobs_to_delete = []

def tearDown(self):
errors = (
exceptions.TooManyRequests,
exceptions.ServiceUnavailable,
)
retry = RetryErrors(errors, max_tries=6)
for blob in self.case_blobs_to_delete:
blob.delete()
retry(blob.delete)()


class TestStorageWriteFiles(TestStorageFiles):
Expand Down Expand Up @@ -576,8 +581,13 @@ def setUpClass(cls):

@classmethod
def tearDownClass(cls):
errors = (
exceptions.TooManyRequests,
exceptions.ServiceUnavailable,
)
retry = RetryErrors(errors, max_tries=6)
for blob in cls.suite_blobs_to_delete:
blob.delete()
retry(blob.delete)()

@RetryErrors(unittest.TestCase.failureException)
def test_list_files(self):
Expand Down Expand Up @@ -642,8 +652,13 @@ def setUpClass(cls):

@classmethod
def tearDownClass(cls):
errors = (
exceptions.TooManyRequests,
exceptions.ServiceUnavailable,
)
retry = RetryErrors(errors, max_tries=6)
for blob in cls.suite_blobs_to_delete:
blob.delete()
retry(blob.delete)()

@RetryErrors(unittest.TestCase.failureException)
def test_blob_get_w_delimiter(self):
Expand Down Expand Up @@ -716,9 +731,14 @@ def setUp(self):
self.case_blobs_to_delete.append(blob)

def tearDown(self):
errors = (
exceptions.TooManyRequests,
exceptions.ServiceUnavailable,
)
retry = RetryErrors(errors, max_tries=6)
for blob in self.case_blobs_to_delete:
if blob.exists():
blob.delete()
retry(blob.delete)()

def test_create_signed_read_url(self):
blob = self.bucket.blob('LogoToSign.jpg')
Expand Down