@@ -28,7 +28,8 @@ async fn long_running_exec_delete(cx: &mut Context) -> testkit::Result {
2828 . await ?
2929 . expect_stdout ( & format ! ( "{marker}\n " ) ) ?;
3030
31- cx. delete_and_expect_absent ( & sandbox) . await
31+ sandbox. delete ( ) . await ?;
32+ sandbox. expect_absent ( ) . await
3233}
3334
3435/// Longer than the supervisor's 30s startup recovery deadline.
@@ -52,8 +53,8 @@ async fn exec_outlives_startup_recovery_deadline(cx: &mut Context) -> testkit::R
5253 PAST_RECOVERY_DEADLINE . as_secs( )
5354 ) ;
5455 with_deadline (
55- PAST_RECOVERY_EXEC_DEADLINE ,
5656 "the exec past the recovery deadline" ,
57+ PAST_RECOVERY_EXEC_DEADLINE ,
5758 sandbox. exec ( [ "sh" , "-c" , script. as_str ( ) ] ) ,
5859 )
5960 . await ?
@@ -114,9 +115,12 @@ async fn delete_is_prompt_when_workload_is_slow_to_handle_term(
114115 // Boundary containment may kill the workload before its handler finishes;
115116 // this asserts bounded deletion, not a graceful workload exit.
116117 with_deadline (
117- DELETE_DEADLINE ,
118118 & format ! ( "deleting sandbox {}" , sandbox. name( ) ) ,
119- cx. delete_and_expect_absent ( & sandbox) ,
119+ DELETE_DEADLINE ,
120+ async {
121+ sandbox. delete ( ) . await ?;
122+ sandbox. expect_absent ( ) . await
123+ } ,
120124 )
121125 . await
122126}
@@ -160,7 +164,8 @@ async fn run_to_completion_exit_delete(cx: &mut Context) -> testkit::Result {
160164 again. restart_count
161165 ) ;
162166
163- cx. delete_and_expect_absent ( & sandbox) . await
167+ sandbox. delete ( ) . await ?;
168+ sandbox. expect_absent ( ) . await
164169}
165170
166171/// A main command that exits during provisioning is reported as the
@@ -236,7 +241,7 @@ async fn default_command_sandbox_is_listed_ready(cx: &mut Context) -> testkit::R
236241 ready. name,
237242 sandbox. name( )
238243 ) ;
239- cx . expect_listed ( & sandbox , SandboxPhase :: Ready ) . await ?;
244+ sandbox . expect_listed ( SandboxPhase :: Ready ) . await ?;
240245
241246 let marker = format ! ( "openshell-e2e-{}" , cx. run_id( ) ) ;
242247 sandbox
@@ -246,7 +251,8 @@ async fn default_command_sandbox_is_listed_ready(cx: &mut Context) -> testkit::R
246251 // The gateway's default image is OpenShell's Ubuntu base image.
247252 crate :: image:: expect_ubuntu ( & sandbox) . await ?;
248253
249- cx. delete_and_expect_absent ( & sandbox) . await
254+ sandbox. delete ( ) . await ?;
255+ sandbox. expect_absent ( ) . await
250256}
251257
252258/// A stopped sandbox rejects exec, accepts a second stop, and returns to
@@ -291,7 +297,8 @@ async fn stopped_sandbox_can_be_deleted(cx: &mut Context) -> testkit::Result {
291297 . create_ready ( )
292298 . await ?;
293299 sandbox. stop ( ) . await ?;
294- cx. delete_and_expect_absent ( & sandbox) . await
300+ sandbox. delete ( ) . await ?;
301+ sandbox. expect_absent ( ) . await
295302}
296303
297304/// Where the main command of [`canonical_main_environment`] records what it
422429 )
423430 . await ?;
424431
425- let initial = cx . sandbox_details ( sandbox. name ( ) ) . await ?;
432+ let initial = sandbox. get_json ( ) . await ?;
426433 let initial_instance = main_instance ( & initial) . to_string ( ) ;
427434 testkit:: ensure!(
428435 !initial_instance. is_empty( ) ,
438445 RESTART_TIMEOUT ,
439446 Duration :: from_millis ( 250 ) ,
440447 async || {
441- let details = cx . sandbox_details ( sandbox. name ( ) ) . await ?;
448+ let details = sandbox. get_json ( ) . await ?;
442449 let instance = main_instance ( & details) ;
443450 let replaced = !instance. is_empty ( ) && instance != initial_instance;
444451 Ok (
471478}
472479
473480/// The ID of the sandbox's current main process instance, from
474- /// [`Context::sandbox_details `]. Empty if none is reported.
481+ /// [`Sandbox::get_json `]. Empty if none is reported.
475482fn main_instance ( details : & serde_json:: Value ) -> & str {
476483 details[ "main_process_instance_id" ]
477484 . as_str ( )
@@ -509,7 +516,8 @@ async fn detached_no_keep_sandbox_is_removed_after_main_exits(cx: &mut Context)
509516 . success ( ) ?;
510517 }
511518 for ( sandbox, _, code) in & sandboxes {
512- cx. wait_absent ( sandbox, EPHEMERAL_CLEANUP_TIMEOUT )
519+ sandbox
520+ . wait_absent ( EPHEMERAL_CLEANUP_TIMEOUT )
513521 . await
514522 . context ( format ! ( "ephemeral sandbox exited {code}" ) ) ?;
515523 }
0 commit comments