Skip to content

Commit 33caf33

Browse files
luvs01Wibias
andauthored
test(windows): retry one transient CIM timeout (#801)
Co-authored-by: luvs01 <27862058+luvs01@users.noreply.github.com> Co-authored-by: Wibias <37517432+Wibias@users.noreply.github.com>
1 parent 8b9347a commit 33caf33

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

tests/codex-app-server-processes.test.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)