test(windows): retry one transient CIM enumeration timeout - #801
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Windows integration probe now runs longer, uses ChangesWindows probe timing
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Three CI runs failed only on windows-latest, each on a different test, all passing locally. Two of them share a cause: the test waits on something the runner controls, and Bun's 5s budget expires first. Sidebar routes spawned the user's real gh. 0af17fb already fixed the Windows .cmd shim resolution, and the tests still timed out after it, because resolving the binary correctly does not make an external process fast on a loaded runner. star-state.ts already had a StarDeps seam with an injectable runGh; setStarDepsForTests() selects it. The route tests now assert what they actually claim — reachability, shape, and that no gh output, token, or account identifier is ever serialized — against a deterministic fake, in 0.25ms instead of 5s. Production keeps the real runner. Server auth built four proxy/upstream harnesses inside one test. On Windows the startup cost alone exhausted the budget, and the last request was still in flight when the next test began, racing it through global fetch. One harness now serves all four malformed-detail cases; each still proves its exact original 400 and a single acct-pool-a dispatch. No timeout was raised, no assertion deleted, no test skipped. Those would have traded a reliability signal for silence. The tray failure is NOT fixed. It launches PowerShell, then Bun, then rebinds the same port, and proving the child does not inherit the listen socket is the whole point of the test. Making it deterministic needs a process-launch seam in src/tray/windows.ts, and faking it only in the test would delete the proof. Left alone deliberately; PR #801 targets a neighbouring Windows enumeration flake.
8bd15c4 to
1b532c4
Compare
[shipping-github] Verdict: approve-commentPR: UsefulnessReal CI flake fix. Windows job on PR Bugs / correctness
Security
Spec / standards
Reviews
Base / CI
Gatenone Bottom lineShip it. Narrow, evidence-backed test reliability fix that does not weaken production fail-closed enumeration. Ready for merge when you want it. |
[shipping-github] Merge readyPR: Reviews
Tip freshness
Checks
Residualnone / out of scope: broader Windows GUI / Bun stability work tracked on Ready to merge. |
|
Thanks @luvs01 — merging this. Why it helps: Windows CI was failing Ship it. |
Summary
Atomics.waitsettle withBun.sleepSyncand keep the probe alive long enough for two bounded 12-second enumerations.listWindowsSnapshots()timeout and fail-closed empty-result behavior unchanged.Root cause
The Windows job on PR #750 failed this integration test after 12.70 seconds, which matches the production enumerator's 12-second
execFileSyncdeadline. The catch path correctly returned an empty snapshot list, but the test treated one transient PowerShell/CIM stall as a product regression.The exact PR base and current
devboth passed the same test in about 0.85 seconds, so extending the production timeout would weaken a deliberate safety bound without addressing the test flake. This change instead permits one test-only retry and still fails after two consecutive stalls or any real owner/command-line matching regression.Evidence:
devpass: https://github.com/lidge-jun/opencodex/actions/runs/30604741234/job/91074598982Verification
tests/codex-app-server-processes.test.ts --rerun-each 10— 180 passed, 0 failed.bun run typecheck— passed.bun run privacy:scan— passed.git diff --check— passed.CI follow-up
The changed Windows process-enumeration test passed in the initial CI. Two unrelated 5-second integration probes timed out elsewhere in that full-suite run:
GET /api/github/star: https://github.com/lidge-jun/opencodex/actions/runs/30607140666/job/91081678963shellStreamExec completion acknowledgement: https://github.com/lidge-jun/opencodex/actions/runs/30607140666/job/91081678979The source branch does not touch either test. Current head
1b532c4eis rebased onto currentdev(81f3f689), which triggered a fresh cross-platform run. Following the maintainer's latest direction, this PR is ready for review while the new checks complete.Summary by CodeRabbit