fix(tests): release agent-os SQLite handle before rmSync in server-live - #1
Open
paopaonyapi-creator wants to merge 1 commit into
Open
paopaonyapi-creator wants to merge 1 commit into
paopaonyapi-creator wants to merge 1 commit into
Conversation
On Windows the process-global WAL handle kept tests/.tmp-server-live-test locked, so beforeEach/afterEach rmSync failed with EBUSY and cascaded into 35/35 failures in that file. Close the handle via closeAgentOsDbForTests() before touching the tree; Linux/CI behavior is unchanged.
|
✅ Deterministic PR hygiene checks passed. |
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.
Summary
tests/server-live.test.ts:rmSync(TEST_DIR, { recursive: true })in thebeforeEach/afterEachhooks fails withEBUSYwhen the process-global agent-os SQLite WAL handle is still open against the test'sOPENCODEX_HOMEtree.startServerwires the generation orchestrator, whose storage lazily opens that handle. On Windows an open file handle keeps the directory busy (Linux silently unlinks the open file, which is why CI never saw this), so every file in the suite reported EBUSY and 0/35 tests could run.closeAgentOsDbForTests()before touching the test tree in bothbeforeEachandafterEach, releasing any handle left behind by a previous file in the shared test process.Verification
bun run typecheck(bun x tsc --noEmit, strict) — passes with no errors on this branch.bun test tests/server-live.test.ts --timeout 20000— 35 pass / 0 fail / 0 EBUSY (274 expect() calls).EBUSY: resource busy or lockedonrmSync(Windows).scripts/test.ts):tests/server-live.test.tsreports 0 failures; the remaining failure clusters (management-provider-validation,server-images) were reproduced in isolation as pre-existing WindowsEBUSYon their ownrmSync(TEST_DIR)calls in files this change does not touch.Checklist