diff --git a/system_tests/logging_.py b/system_tests/logging_.py index a4dca1911dc0..3ba39edc8912 100644 --- a/system_tests/logging_.py +++ b/system_tests/logging_.py @@ -15,6 +15,7 @@ import logging import unittest +from google.cloud.exceptions import TooManyRequests import google.cloud.logging import google.cloud.logging.handlers.handlers from google.cloud.logging.handlers.handlers import CloudLoggingHandler @@ -28,6 +29,7 @@ _RESOURCE_ID = unique_resource_id('-') DEFAULT_FILTER = 'logName:syslog AND severity>=INFO' DEFAULT_DESCRIPTION = 'System testing' +retry_429 = RetryErrors(TooManyRequests) def _retry_on_unavailable(exc): @@ -291,7 +293,8 @@ def _init_storage_bucket(self): # Create the destination bucket, and set up the ACL to allow # Stackdriver Logging to write into it. storage_client = storage.Client() - bucket = storage_client.create_bucket(BUCKET_NAME) + bucket = storage_client.bucket(BUCKET_NAME) + retry_429(bucket.create)() self.to_delete.append(bucket) bucket.acl.reload() logs_group = bucket.acl.group('cloud-logs@google.com')