@@ -1046,10 +1046,7 @@ mod lifecycle_tests {
10461046 // Positive proof: the in-policy write materializes the host artifact.
10471047 let host_path = std:: path:: Path :: new ( tmp. path ( ) ) . join ( "hello.txt" ) ;
10481048 let mut found = false ;
1049- // PowerShell startup can be slow on a cold or heavily loaded Windows
1050- // runner. Wait long enough to distinguish startup latency from a child
1051- // that never executed.
1052- for _ in 0 ..400 {
1049+ for _ in 0 ..100 {
10531050 if host_path. exists ( ) {
10541051 found = true ;
10551052 break ;
@@ -1195,12 +1192,11 @@ mod lifecycle_tests {
11951192 async fn stop_terminates_and_reaps_a_running_process_container ( ) {
11961193 let tmp = tempfile:: tempdir ( ) . unwrap ( ) ;
11971194 let share = tmp. path ( ) . to_string_lossy ( ) . replace ( '\\' , "/" ) ;
1198- let marker = format ! ( "{share}/started.txt" ) ;
11991195 let command = vec ! [
12001196 "powershell" . into( ) ,
12011197 "-NoProfile" . into( ) ,
12021198 "-Command" . into( ) ,
1203- format! ( "Set-Content -LiteralPath '{marker}' -Value started; Start-Sleep -Seconds 60") ,
1199+ " Start-Sleep -Seconds 60". into ( ) ,
12041200 ] ;
12051201 let backend = MxcComputeBackend :: new_mocked ( MxcComputeConfig :: default ( ) ) ;
12061202 backend
@@ -1217,17 +1213,9 @@ mod lifecycle_tests {
12171213 } )
12181214 . await
12191215 . expect ( "long-running child should start" ) ;
1220- let marker_path = std:: path:: Path :: new ( tmp. path ( ) ) . join ( "started.txt" ) ;
1221- for _ in 0 ..100 {
1222- if marker_path. exists ( ) {
1223- break ;
1224- }
1225- tokio:: time:: sleep ( Duration :: from_millis ( 25 ) ) . await ;
1226- }
1227- assert ! (
1228- marker_path. exists( ) ,
1229- "the long-running child must execute before stop tests cancellation"
1230- ) ;
1216+ tokio:: time:: sleep ( Duration :: from_millis ( 250 ) ) . await ;
1217+ let running = backend. get_sandbox ( "sb-stop" ) . await . unwrap ( ) ;
1218+ assert_eq ! ( ready_condition( & running) . unwrap( ) . reason, "AgentRunning" ) ;
12311219
12321220 tokio:: time:: timeout ( Duration :: from_secs ( 5 ) , backend. stop_sandbox ( "sb-stop" ) )
12331221 . await
0 commit comments