Skip to content

test(cc-switch): finalize the F1/F2 fixture statements before cleanup - #8002

Merged
lidge-jun merged 1 commit into
devfrom
test/cc-switch-finalize-all-statements-20261030
Oct 30, 2026
Merged

lidge-jun merged 1 commit into
devfrom
test/cc-switch-finalize-all-statements-20261030

Conversation

@lidge-jun

Copy link
Copy Markdown
Owner

Summary

Completes the fix #7986 started for tests/providers/cc-switch-import.test.ts on Windows. #7986 released the F3 WAL writer's statements. The F1/F2 case (word-shaped canary…) builds its fixture database with db.prepare(...).run(...) the same way, twice, and never finalizes those statements. On Windows the unfinalized statements keep the SQLite file open after db.close(). The test's cleanup (removeTreeWithRetry, line 104) then retries for 15 s and fails with EBUSY. That happened in a local run of Windows shard 2/11 at ac0833bc5, a head that already includes the F3 fix. Whether a run hits it depends on when garbage collection finalizes the statements.

F1/F2 now inserts with db.run(sql, ...params), which finalizes each statement, and its assertions are unchanged. The shared seeder at line 67 already calls finalize() and is the only remaining prepare() in the file.

Verification

  • Mechanism probe on Windows, run twice: create a db, run prepare(...).run(...), then close() and remove the directory: EBUSY both times. The same steps with db.run(sql, value) remove the directory both times.
  • bun test tests/providers/cc-switch-import.test.ts on Windows: 9 pass / 0 fail.
  • NOT RUN: full local suite (shared host). Hosted Windows coverage comes from the batched lane=all dispatch on dev.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed. (Test-only.)
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults. (Test-only; canary fixture values unchanged.)

Like F3 (#7986), F1/F2 inserted with unfinalized prepare().run() statements, which keep the SQLite file open past close() on Windows and make the temp-tree cleanup fail with EBUSY. Use db.run(sql, ...params).
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner October 30, 2026 13:09
@coderabbitai

coderabbitai Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 7 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 9922f81 and a42cadb.

Files selected for processing: 1
  • tests/providers/cc-switch-import.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). label Oct 30, 2026
@lidge-jun

Copy link
Copy Markdown
Owner Author

Maintainer integration (lane L1, cross-platform CI). Squash-merging into dev under the maintainer-integration exception in MAINTAINERS.md. This records the decision; it is not a self-approval.

Exact head: a42cadb2ebafe53285968994bbfd807afe375e98
Exact-head CI: CI run 41060948013 (headSha a42cadb…, conclusion success): gates, test changed and ci success, plus enforce-target and hygiene.
Review: a fresh independent reviewer, not the author, returned PASS at this head. It confirmed that exactly the two F1/F2 prepare().run() calls changed, with SQL, parameter order and values identical and no assertion changed. The only remaining prepare() (line 67) is finalized. It reproduced the EBUSY mechanism on Windows with its own probe and confirmed that the db.run() control removes the directory. The file passed 9/0.
Union check: one existing test file is modified, with no layout or baseline change, and git merge-tree against current dev is clean.

@lidge-jun
lidge-jun merged commit b53b5d2 into dev Oct 30, 2026
26 checks passed
@lidge-jun
lidge-jun deleted the test/cc-switch-finalize-all-statements-20261030 branch October 30, 2026 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant