@@ -346,10 +346,12 @@ async def test_suspend_and_resume(self, async_sdk_client: AsyncRunloopSDK) -> No
346346 info = await devbox .get_info ()
347347 assert info .status == "suspended"
348348
349- # Resume the devbox - resume() automatically waits for running state
350- resumed_info = await devbox .resume (
351- polling_config = PollingConfig (timeout_seconds = 120.0 , interval_seconds = 5.0 )
352- )
349+ # Resume the devbox
350+ resumed_info = await devbox .resume ()
351+ if resumed_info .status != "running" :
352+ resumed_info = await devbox .await_running (
353+ polling_config = PollingConfig (timeout_seconds = 120.0 , interval_seconds = 5.0 )
354+ )
353355 assert resumed_info .status == "running"
354356
355357 # Verify running state
@@ -358,43 +360,6 @@ async def test_suspend_and_resume(self, async_sdk_client: AsyncRunloopSDK) -> No
358360 finally :
359361 await devbox .shutdown ()
360362
361- @pytest .mark .timeout (TWO_MINUTE_TIMEOUT )
362- async def test_resume_async (self , async_sdk_client : AsyncRunloopSDK ) -> None :
363- """Test resuming a devbox asynchronously without waiting."""
364- devbox = await async_sdk_client .devbox .create (
365- name = unique_name ("sdk-async-devbox-resume-async" ),
366- launch_parameters = {"resource_size_request" : "SMALL" , "keep_alive_time_seconds" : 60 * 5 },
367- )
368-
369- try :
370- # Suspend the devbox
371- suspended_info = await devbox .suspend ()
372- if suspended_info .status != "suspended" :
373- suspended_info = await devbox .await_suspended (
374- polling_config = PollingConfig (timeout_seconds = 120.0 , interval_seconds = 5.0 )
375- )
376- assert suspended_info .status == "suspended"
377-
378- # Verify suspended state
379- info = await devbox .get_info ()
380- assert info .status == "suspended"
381-
382- # Resume the devbox asynchronously - doesn't wait automatically
383- resume_response = await devbox .resume_async ()
384- assert resume_response is not None
385-
386- # Status might still be suspended or transitioning
387- info_after_resume = await devbox .get_info ()
388- assert info_after_resume .status in ["suspended" , "running" , "starting" ]
389-
390- # Now wait for running state explicitly
391- running_info = await devbox .await_running (
392- polling_config = PollingConfig (timeout_seconds = 120.0 , interval_seconds = 5.0 )
393- )
394- assert running_info .status == "running"
395- finally :
396- await devbox .shutdown ()
397-
398363 @pytest .mark .timeout (TWO_MINUTE_TIMEOUT )
399364 async def test_await_running (self , async_sdk_client : AsyncRunloopSDK ) -> None :
400365 """Test await_running method."""
0 commit comments