File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 1515import os
1616import uuid
1717
18+ import backoff
19+ from google .api_core .exceptions import ServiceUnavailable
1820from google .cloud import dataproc_v1 as dataproc
1921from google .cloud import storage
2022import pytest
3941@pytest .fixture (autouse = True )
4042def setup_teardown ():
4143 storage_client = storage .Client ()
42- bucket = storage_client .create_bucket (STAGING_BUCKET )
44+
45+ @backoff .on_exception (backoff .expo ,
46+ ServiceUnavailable ,
47+ max_tries = 5 )
48+ def create_bucket ():
49+ return storage_client .create_bucket (STAGING_BUCKET )
50+
51+ bucket = create_bucket ()
4352 blob = bucket .blob (JOB_FILE_NAME )
4453 blob .upload_from_string (SORT_CODE )
4554
Original file line number Diff line number Diff line change 1+
2+ backoff == 1.10.0
13grpcio == 1.36.0
24google-auth == 1.27.0
35google-auth-httplib2 == 0.0.4
You can’t perform that action at this time.
0 commit comments