Skip to content

Commit 5a3fed0

Browse files
cojencoleahecole
andauthored
fix(storage): add backoff to retry flaky test (GoogleCloudPlatform#6745)
Co-authored-by: Leah E. Cole <6719667+leahecole@users.noreply.github.com>
1 parent 8429f08 commit 5a3fed0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

storage/cloud-client/acl_test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,15 @@ def test_print_bucket_acl_for_user(test_bucket, capsys):
8585
assert "OWNER" in out
8686

8787

88+
@backoff.on_exception(backoff.expo, HttpError, max_time=60)
8889
def test_add_bucket_owner(test_bucket):
8990
storage_add_bucket_owner.add_bucket_owner(test_bucket.name, TEST_EMAIL)
9091

9192
test_bucket.acl.reload()
9293
assert "OWNER" in test_bucket.acl.user(TEST_EMAIL).get_roles()
9394

9495

96+
@backoff.on_exception(backoff.expo, HttpError, max_time=60)
9597
def test_remove_bucket_owner(test_bucket):
9698
test_bucket.acl.user(TEST_EMAIL).grant_owner()
9799
test_bucket.acl.save()
@@ -103,6 +105,7 @@ def test_remove_bucket_owner(test_bucket):
103105
assert "OWNER" not in test_bucket.acl.user(TEST_EMAIL).get_roles()
104106

105107

108+
@backoff.on_exception(backoff.expo, HttpError, max_time=60)
106109
def test_add_bucket_default_owner(test_bucket):
107110
storage_add_bucket_default_owner.add_bucket_default_owner(
108111
test_bucket.name, TEST_EMAIL
@@ -113,6 +116,7 @@ def test_add_bucket_default_owner(test_bucket):
113116
assert "OWNER" in roles
114117

115118

119+
@backoff.on_exception(backoff.expo, HttpError, max_time=60)
116120
def test_remove_bucket_default_owner(test_bucket):
117121
test_bucket.acl.user(TEST_EMAIL).grant_owner()
118122
test_bucket.acl.save()
@@ -146,6 +150,7 @@ def test_print_blob_acl_for_user(test_blob, capsys):
146150
assert "OWNER" in out
147151

148152

153+
@backoff.on_exception(backoff.expo, HttpError, max_time=60)
149154
def test_add_blob_owner(test_blob):
150155
storage_add_file_owner.add_blob_owner(
151156
test_blob.bucket.name, test_blob.name, TEST_EMAIL)
@@ -154,6 +159,7 @@ def test_add_blob_owner(test_blob):
154159
assert "OWNER" in test_blob.acl.user(TEST_EMAIL).get_roles()
155160

156161

162+
@backoff.on_exception(backoff.expo, HttpError, max_time=60)
157163
def test_remove_blob_owner(test_blob):
158164
test_blob.acl.user(TEST_EMAIL).grant_owner()
159165
test_blob.acl.save()

0 commit comments

Comments
 (0)