tests: Tolerate NoSuchBucket errors when cleaning up
Sometimes we'll get back a 503 on the initial attempt, though the delete succeeded on the backend. Then when the client automatically retries, it gets back a 404. Change-Id: I6d8d5af68884b08e22fd8a332f366a0b81acb7ed
This commit is contained in:
1 changed files with 4 additions and 0 deletions
@@ -190,6 +190,8 @@ class BaseS3TestCase(unittest.TestCase):
try:
client.delete_bucket(Bucket=bucket_name)
except ClientError as e:
if 'NoSuchBucket' in str(e):
return
if 'BucketNotEmpty' not in str(e):
raise
# Something's gone sideways. Try harder
@@ -208,6 +210,8 @@ class BaseS3TestCase(unittest.TestCase):
try:
client.delete_bucket(Bucket=bucket_name)
except ClientError as e:
if 'NoSuchBucket' in str(e):
return
if 'BucketNotEmpty' not in str(e):
raise
if time.time() > timeout:
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.