test(codex): give each active-writer server its own runtime.db - #884
Merged
Conversation
RonenMars
force-pushed
the
test/codex-writer-runtime-db-isolation
branch
2 times, most recently
from
September 12, 2026 07:16
b04fb97 to
e052e36
Compare
startServer built a per-server cacheDir but let runtime.db fall through to the shared default. The adopt cases register a managed session there, and runtime.db deliberately outlives server.close(), so a later server's boot reconcile probed the previous case's pid through isPidAlive. That probe is process.kill(pid, 0), which sends no signal but is still recorded by the kill spy in the two cases asserting that nothing was killed. Those cases pass today only because the fire-and-forget reconcile usually lands outside the spy's window; running just the takeover case and one refusal together already fails on main.
RonenMars
force-pushed
the
test/codex-writer-runtime-db-isolation
branch
from
September 12, 2026 07:32
e052e36 to
ed5fae8
Compare
RonenMars
enabled auto-merge (squash)
September 12, 2026 07:32
Owner
Author
|
🎉 This PR is included in version 1.90.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
startServerin__tests__/codex-active-writer.test.tsbuilds a per-servercacheDirbut letsruntime.dbfall through to the shared default.The adopt cases register a managed session, and
runtime.dbis the authoritative store that deliberately outlivesserver.close().So a later server's boot reconcile picks that row up through
reconcilePreviousSessionsand probes the previous case's pid withisPidAlive, which isprocess.kill(pid, 0).That sends no signal, but the two cases asserting "and kills nothing" spy on
process.killbroadly enough to record it, and they fail.Why this is worth fixing rather than tolerating
It passes on main today only because the reconcile is fire-and-forget and usually lands outside the spy's window.
Running just the takeover case and one refusal together already fails on main:
npx vitest run __tests__/codex-active-writer.test.ts -t "take".Anything that shifts startup timing turns a latent ordering dependency into a red suite, and the failure points at the scanner rather than at test isolation, which costs the next reader real time.
The change
Hoist the temp dir into a local and pass
runtimeDbPath: join(dir, "runtime.db")alongside the existingcacheDir, matching howaccess-probe.test.tsandauto-resume-on-boot.test.tsalready isolate it.Verification
The file passes 12/12 on main with this fix.
It also passes 12/12 with the #876 scanner change applied on top, which is the state that surfaced the problem.
Full suite on this branch: 283 files, 3062 passed, 0 failed, lint clean across 517 files.
Unblocks #879.