@@ -359,16 +359,23 @@ describe("Windows Win32_Process owner enumeration (#476)", () => {
359359 [
360360 "-NoProfile" , "-NoLogo" , "-NonInteractive" , "-WindowStyle" , "Hidden" ,
361361 "-Command" ,
362- "Start-Sleep -Seconds 25 # codex app-server integration-probe" ,
362+ "Start-Sleep -Seconds 45 # codex app-server integration-probe" ,
363363 ] ,
364364 { stdio : "ignore" , windowsHide : true } ,
365365 ) ;
366366 try {
367367 expect ( child . pid ) . toBeGreaterThan ( 1 ) ;
368- // Brief settle so Win32_Process can observe the child.
369- Atomics . wait ( new Int32Array ( new SharedArrayBuffer ( 4 ) ) , 0 , 0 , 250 ) ;
370- const snapshots = listWindowsSnapshots ( ) ;
371- const match = snapshots . find ( snapshot => snapshot . pid === child . pid ) ;
368+ // Brief settle so Win32_Process can observe the child. A loaded Windows
369+ // runner can also exhaust one CIM enumeration deadline, so tolerate one
370+ // transient empty result while keeping the production timeout unchanged.
371+ Bun . sleepSync ( 250 ) ;
372+ let snapshots = listWindowsSnapshots ( ) ;
373+ let match = snapshots . find ( snapshot => snapshot . pid === child . pid ) ;
374+ if ( ! match ) {
375+ Bun . sleepSync ( 250 ) ;
376+ snapshots = listWindowsSnapshots ( ) ;
377+ match = snapshots . find ( snapshot => snapshot . pid === child . pid ) ;
378+ }
372379 expect ( match ) . toBeDefined ( ) ;
373380 expect ( match ! . owner ) . toMatch ( / \\ / ) ;
374381 expect ( match ! . commandLine . toLowerCase ( ) ) . toContain ( "codex app-server" ) ;
@@ -381,6 +388,6 @@ describe("Windows Win32_Process owner enumeration (#476)", () => {
381388 }
382389 }
383390 } ,
384- { timeout : 30_000 } ,
391+ { timeout : 35_000 } ,
385392 ) ;
386393} ) ;
0 commit comments