diff --git a/tests/integration/customizations/s3/test_plugin.py b/tests/integration/customizations/s3/test_plugin.py index 0536bb1d179a..313977b4e315 100644 --- a/tests/integration/customizations/s3/test_plugin.py +++ b/tests/integration/customizations/s3/test_plugin.py @@ -1372,8 +1372,14 @@ def test_mb_rb(self, s3_utils): self.assert_no_errors(p) def test_fail_mb_rb(self): - # Choose a bucket name that already exists. - p = aws('s3 mb s3://mybucket') + # S3 can intermittently return an `OperationAborted` exception instead of + # `BucketAlreadyExists`, so we give this test four attempts + for i in range(4): + # Choose a bucket name that already exists. + p = aws('s3 mb s3://mybucket') + if "OperationAborted" not in p.stderr: + break + time.sleep(2**i) assert "BucketAlreadyExists" in p.stderr assert p.rc == 1