Skip to content

Commit 4c68d5b

Browse files
committed
Update test_plugin.py
1 parent 00b7868 commit 4c68d5b

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

tests/integration/customizations/s3/test_plugin.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,10 +1310,17 @@ def test_mb_rb(self):
13101310
self.assert_no_errors(p)
13111311

13121312
def test_fail_mb_rb(self):
1313-
# Choose a bucket name that already exists.
1314-
p = aws('s3 mb s3://mybucket')
1315-
self.assertIn("BucketAlreadyExists", p.stderr)
1316-
self.assertEqual(p.rc, 1)
1313+
#S3 can intermittenly return an `OperationAborted` exception instead of
1314+
# `BucketAlreadyExists`, so we give this test three attempts
1315+
for i in range(4):
1316+
# Choose a bucket name that already exists.
1317+
p = aws('s3 mb s3://mybucket')
1318+
if "BucketAlreadyExists" in p.stderr:
1319+
break
1320+
time.sleep(2**i)
1321+
assert "BucketAlreadyExists" in p.stderr
1322+
assert p.rc == 1
1323+
13171324

13181325

13191326
class TestOutput(BaseS3IntegrationTest):

0 commit comments

Comments
 (0)