File tree 2 files changed +14
-6
lines changed
src/codeflare_sdk/cluster
2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -268,19 +268,27 @@ def wait_ready(self, timeout: Optional[int] = None):
268
268
dashboard_ready = False
269
269
status = None
270
270
time = 0
271
- while not ready or not dashboard_ready :
271
+ while not ready :
272
272
status , ready = self .status (print_to_console = False )
273
- dashboard_ready = self .is_dashboard_ready ()
274
273
if status == CodeFlareClusterStatus .UNKNOWN :
275
274
print (
276
275
"WARNING: Current cluster status is unknown, have you run cluster.up yet?"
277
276
)
278
- if not ready or not dashboard_ready :
277
+ if not ready :
278
+ if timeout and time >= timeout :
279
+ raise TimeoutError (f"wait() timed out after waiting { timeout } s for cluster to be ready" )
280
+ sleep (5 )
281
+ time += 5
282
+ print ("Requested cluster is up and running!" )
283
+
284
+ while not dashboard_ready :
285
+ dashboard_ready = self .is_dashboard_ready ()
286
+ if not dashboard_ready :
279
287
if timeout and time >= timeout :
280
- raise TimeoutError (f"wait() timed out after waiting { timeout } s" )
288
+ raise TimeoutError (f"wait() timed out after waiting { timeout } s for dashboard to be ready " )
281
289
sleep (5 )
282
290
time += 5
283
- print ("Requested cluster and dashboard are up and running !" )
291
+ print ("Dashboard is ready !" )
284
292
285
293
def details (self , print_to_console : bool = True ) -> RayCluster :
286
294
cluster = _copy_to_ray (self )
Original file line number Diff line number Diff line change @@ -1788,7 +1788,7 @@ def test_wait_ready(mocker, capsys):
1788
1788
captured = capsys .readouterr ()
1789
1789
assert (
1790
1790
captured .out
1791
- == "Waiting for requested resources to be set up...\n Requested cluster and dashboard are up and running!\n "
1791
+ == "Waiting for requested resources to be set up...\n Requested cluster is up and running! \n Dashboard is ready !\n "
1792
1792
)
1793
1793
1794
1794
You can’t perform that action at this time.
0 commit comments