From c4851ee17c2c7a3916654e2dad7db54f40f60cb0 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 21 Aug 2026 19:43:07 +0000 Subject: [PATCH] test(codex-cloud): budget the shell-policy case for Windows Git Bash spawns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "writes managed shell policy behaviorally and preserves unrelated Codex config" failed in a full `npm run test` on a Windows workstation while passing in isolation there, and passing everywhere on Linux. It is not a state failure. The test spawns `bash scripts/setup-codex-cloud.sh` twice, which is cheap on Linux and expensive on Windows, where every spawn goes through Git Bash. Measured on that workstation running this file alone: 24.96s against the 30s default in vitest.config.mts — 83% of the budget with nothing else competing. A full run puts four workers on the machine at once, and it tips over. The sibling case immediately below already carries an explicit 120s budget for exactly this reason (it measures 112.9s on the same machine). This one was missed. Give it the same budget and record why, so the next person reading it does not have to re-derive the Windows cost. No assertion changes: the test does the same work and checks the same things. Only the time it is allowed to take moves. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01JEzkroXdtL9kYo8rW5eZh2 --- tests/codex-cloud-setup.test.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/codex-cloud-setup.test.ts b/tests/codex-cloud-setup.test.ts index 59d291826b..e97ef3389b 100644 --- a/tests/codex-cloud-setup.test.ts +++ b/tests/codex-cloud-setup.test.ts @@ -788,7 +788,14 @@ describe("Codex Cloud environment contract", () => { expect(rewritten).toContain("[mcp_servers.example]"); expect(rewritten.match(/^\[shell_environment_policy\]$/gm)).toHaveLength(1); expect(rewritten.match(/BEGIN clinical-kb-codex-cloud shell policy/g)).toHaveLength(1); - }); + // Two full `bash scripts/setup-codex-cloud.sh` runs. That is cheap on Linux + // and is not on Windows, where each spawn goes through Git Bash: measured at + // 24.96s on a Windows workstation running this file ALONE — 83% of the 30s + // default in vitest.config.mts. Under a full `npm run test` the four workers + // contend and it tips over, which is how this failed there while passing in + // isolation and passing everywhere on Linux. The sibling case below already + // carries this budget for the same reason; this one was missed. + }, 120_000); it("pins connected retrieval mode and rejects unsafe shell-policy configs", () => { const connectedHome = temporaryDirectory("codex-cloud-connected-");