@@ -85,7 +85,7 @@ def _retry_on_unavailable(exc):
8585 return exc .code () == StatusCode .UNAVAILABLE
8686
8787
88- retry_429 = RetryErrors (TooManyRequests )
88+ retry_429 = RetryErrors (TooManyRequests , max_tries = 9 )
8989
9090
9191def setUpModule ():
@@ -165,12 +165,13 @@ def test_create_instance_defaults(self):
165165 ALT_CLUSTER_ID , location_id = LOCATION_ID , serve_nodes = SERVE_NODES
166166 )
167167 operation = instance .create (clusters = [cluster ])
168- # We want to make sure the operation completes.
169- operation .result (timeout = 10 )
170168
171169 # Make sure this instance gets deleted after the test case.
172170 self .instances_to_delete .append (instance )
173171
172+ # We want to make sure the operation completes.
173+ operation .result (timeout = 10 )
174+
174175 # Create a new instance instance and make sure it is the same.
175176 instance_alt = Config .CLIENT .instance (ALT_INSTANCE_ID )
176177 instance_alt .reload ()
@@ -194,12 +195,13 @@ def test_create_instance(self):
194195 ALT_CLUSTER_ID = ALT_INSTANCE_ID + "-cluster"
195196 cluster = instance .cluster (ALT_CLUSTER_ID , location_id = LOCATION_ID )
196197 operation = instance .create (clusters = [cluster ])
197- # We want to make sure the operation completes.
198- operation .result (timeout = 10 )
199198
200199 # Make sure this instance gets deleted after the test case.
201200 self .instances_to_delete .append (instance )
202201
202+ # We want to make sure the operation completes.
203+ operation .result (timeout = 10 )
204+
203205 # Create a new instance instance and make sure it is the same.
204206 instance_alt = Config .CLIENT .instance (ALT_INSTANCE_ID )
205207 instance_alt .reload ()
@@ -252,12 +254,13 @@ def test_create_instance_w_two_clusters(self):
252254 default_storage_type = STORAGE_TYPE ,
253255 )
254256 operation = instance .create (clusters = [cluster_1 , cluster_2 ])
255- # We want to make sure the operation completes.
256- operation .result (timeout = 10 )
257257
258258 # Make sure this instance gets deleted after the test case.
259259 self .instances_to_delete .append (instance )
260260
261+ # We want to make sure the operation completes.
262+ operation .result (timeout = 10 )
263+
261264 # Create a new instance instance and make sure it is the same.
262265 instance_alt = Config .CLIENT .instance (ALT_INSTANCE_ID )
263266 instance_alt .reload ()
0 commit comments