File tree 2 files changed +12
-1
lines changed
2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 15
15
import os
16
16
import uuid
17
17
18
+ import backoff
19
+ from google .api_core .exceptions import ServiceUnavailable
18
20
from google .cloud import dataproc_v1 as dataproc
19
21
from google .cloud import storage
20
22
import pytest
39
41
@pytest .fixture (autouse = True )
40
42
def setup_teardown ():
41
43
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 ()
43
52
blob = bucket .blob (JOB_FILE_NAME )
44
53
blob .upload_from_string (SORT_CODE )
45
54
Original file line number Diff line number Diff line change
1
+
2
+ backoff == 1.10.0
1
3
grpcio == 1.36.0
2
4
google-auth == 1.27.0
3
5
google-auth-httplib2 == 0.0.4
You can’t perform that action at this time.
0 commit comments