Skip to content

Commit ded1227

Browse files
committed
Add tenacity retries for bucket creation in testing BucketManager
1 parent d476d7e commit ded1227

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

b2sdk/_internal/testing/helpers/bucket_manager.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ def new_bucket_info(self) -> dict:
8282
'created_by': NODE_DESCRIPTION,
8383
}
8484

85+
@tenacity.retry(
86+
retry=tenacity.retry_if_exception_type(TooManyRequests),
87+
wait=tenacity.wait_exponential(),
88+
stop=tenacity.stop_after_attempt(8),
89+
)
8590
def create_bucket(self, bucket_type: str = 'allPublic', **kwargs) -> Bucket:
8691
bucket_name = kwargs.pop('name', self.new_bucket_name())
8792

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add exponential retries for bucket creation in `testing.helpers.BucketManager`.

0 commit comments

Comments
 (0)