File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515import logging
1616import unittest
1717
18+ from google .cloud .exceptions import TooManyRequests
1819import google .cloud .logging
1920import google .cloud .logging .handlers .handlers
2021from google .cloud .logging .handlers .handlers import CloudLoggingHandler
2829_RESOURCE_ID = unique_resource_id ('-' )
2930DEFAULT_FILTER = 'logName:syslog AND severity>=INFO'
3031DEFAULT_DESCRIPTION = 'System testing'
32+ retry_429 = RetryErrors (TooManyRequests )
3133
3234
3335def _retry_on_unavailable (exc ):
@@ -291,7 +293,8 @@ def _init_storage_bucket(self):
291293 # Create the destination bucket, and set up the ACL to allow
292294 # Stackdriver Logging to write into it.
293295 storage_client = storage .Client ()
294- bucket = storage_client .create_bucket (BUCKET_NAME )
296+ bucket = storage_client .bucket (BUCKET_NAME )
297+ retry_429 (bucket .create )()
295298 self .to_delete .append (bucket )
296299 bucket .acl .reload ()
297300 logs_group = bucket .acl .group ('cloud-logs@google.com' )
You can’t perform that action at this time.
0 commit comments