Skip to content

Commit 23cd2b4

Browse files
Add retries to test fail mb rb (aws#10239)
Co-authored-by: jonathan343 <43360731+jonathan343@users.noreply.github.com>
1 parent 88399c2 commit 23cd2b4

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

tests/integration/customizations/s3/test_plugin.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,8 +1372,14 @@ def test_mb_rb(self, s3_utils):
13721372
self.assert_no_errors(p)
13731373

13741374
def test_fail_mb_rb(self):
1375-
# Choose a bucket name that already exists.
1376-
p = aws('s3 mb s3://mybucket')
1375+
# S3 can intermittently return an `OperationAborted` exception instead of
1376+
# `BucketAlreadyExists`, so we give this test four attempts
1377+
for i in range(4):
1378+
# Choose a bucket name that already exists.
1379+
p = aws('s3 mb s3://mybucket')
1380+
if "OperationAborted" not in p.stderr:
1381+
break
1382+
time.sleep(2**i)
13771383
assert "BucketAlreadyExists" in p.stderr
13781384
assert p.rc == 1
13791385

0 commit comments

Comments
 (0)