Repository navigation
test(codex): share one Bun transpiler cache across write-lock children - #5732
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
✅ Deterministic PR hygiene checks passed. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: lidge-jun/opencodex/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughThe lock integration test now uses a temporary shared transpiler cache for spawned child processes. It warms the cache before the tests and removes it afterward. ChangesLock test cache
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Other Merge Risk: ⚪ Minimal · up to The cache change appears mergeable after normal checks. Windows verification remains planned, but the supplied evidence does not establish a failure that should block merging. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The home-environment cases give every child a fresh fake HOME, and Bun keeps its runtime transpiler cache under the HOME-derived cache directory, so each holder re-transpiled the whole lock graph and the describe's warm-up paid for nothing. On windows-latest those holders took 5-19 s against 1-4 s for the same child with the ambient home, and "case 0" crossed INTERNAL_DEADLINE_MS twice in run 35953803435 after a new test file shifted it to the front of its batch. Pin BUN_RUNTIME_TRANSPILER_CACHE_PATH to one per-process directory for the warm-up and every child. The lock identity under test reads only HOME and USERPROFILE, so no assertion changes.
edbaa81 to
dcb6c8a
Compare
Summary
tests/codex-integration/codex-write-lock.test.tsfailed twice ondev(ci.yml lane=allrun 35953803435, windows 1/9, attempts 1 and 2) with the same error:one OS user and one home take ONE lock, case 0timed out after 15000 ms waiting for the holder child's marker, with the child still running. No product code changed; #5730 added a test file, which shifted this file to the front of its batch on that shard.The cause is in the fixture. The home-environment cases give each child a brand-new fake
HOME/USERPROFILE, and Bun keeps its runtime transpiler cache under the user's home cache directory unlessBUN_RUNTIME_TRANSPILER_CACHE_PATHis set:HOMEon macOS/Linux andUSERPROFILEon Windows (Bun 1.4.0). A child started with a fresh home writes a new@t@cache (261 files, 4.1 MB, measured on macOS), so every holder in those cases re-transpiled the whole lock graph, and the describe'sbeforeAllwarm-up did not help. The Windows logs show the split: in the same describe, children with the ambient home booted in 1.2-3.7 s, while the fake-home cases took 5-19 s.This PR pins
BUN_RUNTIME_TRANSPILER_CACHE_PATHto one per-process temp directory for the warm-up and for every child in the describe, and removes it inafterAll. The explicit override takes precedence on every platform. The lock identity under test is derived only fromHOME/USERPROFILE, so every assertion is unchanged and no budget is raised.Verification
Probe: a fresh
HOMEwithout the pin created 261 cache files under it; two fresh homes with the pin created none (all 261 went to the shared directory).bun test tests/codex-integration/codex-write-lock.test.ts: 20 pass, 0 fail (case 0/1/2 in about 0.3 s each on macOS); the shared cache directory is removed afterwards.bun run typecheck: pass.The Windows proof is
ci.yml lane=allondevafter merge (the owner verifies ondev).Review: gpt-6-sol adversarial review NEAR-PASS (assertions unchanged; cache sharing and cleanup sound; Windows cache-home precision folded into the comment and this description).
Checklist