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 @@ -274,19 +274,27 @@ def wait_ready(self, timeout: Optional[int] = None):
274
274
dashboard_ready = False
275
275
status = None
276
276
time = 0
277
- while not ready or not dashboard_ready :
277
+ while not ready :
278
278
status , ready = self .status (print_to_console = False )
279
- dashboard_ready = self .is_dashboard_ready ()
280
279
if status == CodeFlareClusterStatus .UNKNOWN :
281
280
print (
282
281
"WARNING: Current cluster status is unknown, have you run cluster.up yet?"
283
282
)
284
- if not ready or not dashboard_ready :
283
+ if not ready :
284
+ if timeout and time >= timeout :
285
+ raise TimeoutError (f"wait() timed out after waiting { timeout } s for cluster to be ready" )
286
+ sleep (5 )
287
+ time += 5
288
+ print ("Requested cluster is up and running!" )
289
+
290
+ while not dashboard_ready :
291
+ dashboard_ready = self .is_dashboard_ready ()
292
+ if not dashboard_ready :
285
293
if timeout and time >= timeout :
286
- raise TimeoutError (f"wait() timed out after waiting { timeout } s" )
294
+ raise TimeoutError (f"wait() timed out after waiting { timeout } s for dashboard to be ready " )
287
295
sleep (5 )
288
296
time += 5
289
- print ("Requested cluster and dashboard are up and running !" )
297
+ print ("Dashboard is ready !" )
290
298
291
299
def details (self , print_to_console : bool = True ) -> RayCluster :
292
300
cluster = _copy_to_ray (self )
Original file line number Diff line number Diff line change @@ -1794,7 +1794,7 @@ def test_wait_ready(mocker, capsys):
1794
1794
captured = capsys .readouterr ()
1795
1795
assert (
1796
1796
captured .out
1797
- == "Waiting for requested resources to be set up...\n Requested cluster and dashboard are up and running!\n "
1797
+ == "Waiting for requested resources to be set up...\n Requested cluster is up and running! \n Dashboard is ready !\n "
1798
1798
)
1799
1799
1800
1800
You can’t perform that action at this time.
0 commit comments