Repository navigation
test: target writer timeouts and diagnose Bun startup stalls - #23267
Conversation
|
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 UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe Bun launcher integration test now records runtime phase files and captures process and stream diagnostics. The startup-verdict test logs those diagnostics if its wait for Bun boot output fails. The profile-state writer worker test uses fake timers to verify timeout failure after advancing time by 5,000 ms. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to No actionable issue is established before merge. The hosted persistence matrix, including Windows ARM, remains pending. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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 |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Persistence writer timeout test —
profile-state-writer-worker.test.tsno longer builds thetimeoutfault-mode client with a 150 ms timeout (which let worker startup race the fault timer, the #23077 flake). It uses the default startup budget, then fakes onlysetTimeout/clearTimeoutafterclient.readyand advances 5000 ms, newly asserting the exactprofile-state-writer-timeoutcode alongside the indeterminate outcome, real worker exit, and unchanged DB contents. - Bun launcher startup diagnostics —
orcad-bun-launcher.integration.test.tsprepends an esbuild banner that appends per-runtime phase traces, records timestamped child/stream events inlaunch(), and exposes adiagnostics()snapshot logged only when the 5 s readiness wait fails before rethrowing the original error.
Both changes are failure-path/test-only. The timeout test can genuinely fail (exact code + awaited rejection), timers are restored in finally, and the diagnostics cannot alter a pass/fail verdict.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ No critical issues — the new commits add a test seam to a build script and make the hourly-version tests hermetic. One scope/description note below.
Reviewed changes
getHourlyBuildIdentitytest seam —config/scripts/hourly-build-version.mjsnow accepts an optionalpackageVersion(destructured with the other inputs) and falls back toreadFileSync('package.json')only when it is absent. The CLI caller passes no override, so production behavior is unchanged, and this matchesresolveDevChannelBaseVersion(packageVersion, …), which already takes the version as an argument.- Hermetic hourly-version tests — the historical
getHourlyBuildIdentitycase is pinned topackageVersion: '1.4.201'instead of the checked-inpackage.jsonversion, and a new case asserts a package version above every published tag stays the hourly base floor (1.4.214-hourly.*, build number 1). Both assertions fail without the production seam, so they are real coverage.
ℹ️ PR description and scope no longer match the diff
Technical details
# PR description understates scope
## Affected sites
- `config/scripts/hourly-build-version.mjs:82` — a build script gained an optional `packageVersion` parameter, but the PR body still says "Test-only changes" and "No production … changes".
- `8b735bf5` → `bfce71d` — the hourly build version commits are unrelated to the writer-timeout / Bun-starter CI repairs named in the title and body.
## Required outcome
- The description reflects that the branch now modifies a build script (a behavior-preserving test seam) and touches an unrelated hourly-version area.
## Open questions for the human (optional)
- Should the hourly-version commits ship with this writer/Bun PR, or be split into their own?DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

ELI5
A persistence test could time out while its worker was starting, before reaching the write failure it meant to test. It now waits for startup and then advances only the write timer. A separate Bun launcher test now preserves startup evidence when its existing deadline expires.
What Changed
The writer test uses its existing five-second startup budget and fake timers only after the real worker is ready. It still checks the exact timeout code, indeterminate write outcome, real worker exit, and unchanged database contents.
The launcher fixture records bounded Node/Bun startup phases and child/stream state. On the original five-second readiness failure it prints that evidence, then rethrows the original assertion. Production behavior and timeouts are unchanged.
Why
The macOS failure in #23077 occurred during initialization under a 150 ms fault timer. A controlled 250 ms startup delay reproduces it and passes with the correction. The Windows ARM failure observed on #23256 supplied only an empty output buffer; its cause remains unresolved. Recording phases makes the next failure actionable without increasing deadlines or treating a later pass as proof of a fix.
Linked Issue
None. Investigated from CI failures in #23077 and #23256.
Visual Proof
N/A — test fixtures only; no application UI changes.
Shared hourly CI prerequisite
The branch also carries the shared hourly-build fixture correction from #23274. Historical package-version inputs are explicit, with exact version/build-number assertions retained and a newer-package control. Default build commands still read package.json; the dedicated no-module-mocking lint rule stays enabled.
Testing
ORCA_BACKGROUND_LAUNCH=1.Review
Test-only changes. Real worker/process exit and database assertions remain in place; timers are restored in
finally. Phase files are per-test and per-runtime, printed only on failure before cleanup. The diagnostics do not establish the cause of the historical launcher failure.Agent skill upstream boundary
Notes
No production, SSH, provider, path-selection, or workspace behavior changes.
Checklist