File tree 2 files changed +16
-5
lines changed
src/codeflare_sdk/cluster
2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -264,7 +264,7 @@ def is_dashboard_ready(self) -> bool:
264
264
else :
265
265
return False
266
266
267
- def wait_ready (self , timeout : Optional [int ] = None ):
267
+ def wait_ready (self , timeout : Optional [int ] = None , dashboard_check : bool = True ):
268
268
"""
269
269
Waits for requested cluster to be ready, up to an optional timeout (s).
270
270
Checks every five seconds.
@@ -282,19 +282,24 @@ def wait_ready(self, timeout: Optional[int] = None):
282
282
)
283
283
if not ready :
284
284
if timeout and time >= timeout :
285
- raise TimeoutError (f"wait() timed out after waiting { timeout } s for cluster to be ready" )
285
+ raise TimeoutError (
286
+ f"wait() timed out after waiting { timeout } s for cluster to be ready"
287
+ )
286
288
sleep (5 )
287
289
time += 5
288
290
print ("Requested cluster is up and running!" )
289
291
290
- while not dashboard_ready :
292
+ while dashboard_check and not dashboard_ready :
291
293
dashboard_ready = self .is_dashboard_ready ()
292
294
if not dashboard_ready :
293
295
if timeout and time >= timeout :
294
- raise TimeoutError (f"wait() timed out after waiting { timeout } s for dashboard to be ready" )
296
+ raise TimeoutError (
297
+ f"wait() timed out after waiting { timeout } s for dashboard to be ready"
298
+ )
295
299
sleep (5 )
296
300
time += 5
297
- print ("Dashboard is ready!" )
301
+ if dashboard_ready :
302
+ print ("Dashboard is ready!" )
298
303
299
304
def details (self , print_to_console : bool = True ) -> RayCluster :
300
305
cluster = _copy_to_ray (self )
Original file line number Diff line number Diff line change @@ -1796,6 +1796,12 @@ def test_wait_ready(mocker, capsys):
1796
1796
captured .out
1797
1797
== "Waiting for requested resources to be set up...\n Requested cluster is up and running!\n Dashboard is ready!\n "
1798
1798
)
1799
+ cf .wait_ready (dashboard_check = False )
1800
+ captured = capsys .readouterr ()
1801
+ assert (
1802
+ captured .out
1803
+ == "Waiting for requested resources to be set up...\n Requested cluster is up and running!\n "
1804
+ )
1799
1805
1800
1806
1801
1807
def test_jobdefinition_coverage ():
You can’t perform that action at this time.
0 commit comments