Repository navigation
test: close seeded journal databases before fixture cleanup - #37176
Conversation
|
Warning Review limit reachedYou'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 6 minutes. View limit details
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. |
|
Review loop status: review done, CI green The problem. The journal refusal test suite ( The change. The suite's shared What was verified
Deferred (P3, already on main, outside this fix): the teardown swallows a failed runtime stop ( CI. Green on QA: none needed (test-only change). For Brennan's review
|
The journal refusal test can pass its inventory assertions and then fail CI while removing its temporary directory. Seeding session records leaves a test-owned SQLite connection and checkpoint worker open; stopping the runtime closes a different connection.
Await the existing close-all test database API in the suite’s shared teardown before removing the fixture directory. This closes every seeded connection and waits for checkpoint-worker termination, including when a test fails. Shipped app behavior is unchanged.
Plan: reuse the common pattern of closing owned database resources before deleting their files. Audit record-store harness consumers and their shared teardown, then add the missing close at the fixture cleanup boundary. Budget: 0 production lines and about 2 test lines, one PR, no saved fields or wire changes. No added capability or changed outcome; no older-client or saved-user-data impact; no UI choice; no conflicting ruling. Test-only maintenance uses the short plan; plan review and plan check do not apply.
Path: light; qa=none.
Common-pattern differences: none in the changed teardown; owned database resources close before fixture deletion.
Validation: temporary instrumentation of the reported test on main confirmed that the captured seed database remained open after runtime shutdown (expected isClosed=true, received false). This reproduces the ownership defect, not the intermittent ENOTEMPTY itself. Instrumentation is kept outside the PR; no extra regression test is added for this cleanup-only change. The same temporary assertion passes with the fix. The final named refusal suite passes all 13 tests through tc-gate. Formatting and the pre-commit checks passed.
Tracked in STA-13026.