Skip to content

Commit 9fe5540

Browse files
authored
Retry 'notification.create()' on '503 ServiceUnavailable'. (googleapis#5741)
Closes googleapis#5740.
1 parent 38080c8 commit 9fe5540

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

storage/tests/system.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ def _bad_copy(bad_request):
3939

4040

4141
retry_429 = RetryErrors(exceptions.TooManyRequests)
42+
retry_429_503 = RetryErrors([
43+
exceptions.TooManyRequests, exceptions.ServiceUnavailable])
4244
retry_bad_copy = RetryErrors(exceptions.BadRequest,
4345
error_predicate=_bad_copy)
4446

@@ -938,7 +940,7 @@ def test_notification_minimal(self):
938940
self.case_buckets_to_delete.append(new_bucket_name)
939941
self.assertEqual(list(bucket.list_notifications()), [])
940942
notification = bucket.notification(self.TOPIC_NAME)
941-
retry_429(notification.create)()
943+
retry_429_503(notification.create)()
942944
try:
943945
self.assertTrue(notification.exists())
944946
self.assertIsNotNone(notification.notification_id)
@@ -959,7 +961,7 @@ def test_notification_explicit(self):
959961
blob_name_prefix=self.BLOB_NAME_PREFIX,
960962
payload_format=self.payload_format(),
961963
)
962-
retry_429(notification.create)()
964+
retry_429_503(notification.create)()
963965
try:
964966
self.assertTrue(notification.exists())
965967
self.assertIsNotNone(notification.notification_id)

0 commit comments

Comments
 (0)