Repository navigation
test(config): accept a refused uninstall in the concurrent ownership race - #8556
shu-chen-dot-ca wants to merge 1 commit into
Conversation
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Review readiness checklist
0/4 boxes ticked. This PR stays in draft until every box above is ticked. Hygiene✅ Deterministic PR hygiene checks passed. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…race When the racing registrations keep the ownership lock busy, uninstall returns refused before it writes its tombstone, and the registrations then succeed. The race test still expected every recorded file to be removed. It now checks the refused outcome as its own case (no tombstone, every registration recorded, a rerun removes the home), and a new test forces that path by running uninstall while the lock is held. Closes lidge-jun#8379
|
Rebased onto the current |
c73242b to
3d09ccc
Compare
Summary
a registration racing uninstall is either removed or refused, never left unreportedassumed uninstall always gets the ownership lock. After the gate opens, the gated children may still hold the lock whenremoveOwnedConfigStateruns. Uninstall then fails fast withrefused("could not lock the ownership manifest ... busy") before it writes its tombstone, so every child records its path afterwards. That outcome is correct, because the home stays intact. The test still expected each recorded file to be removed, which is theexpected false, received truefailure at theexistsSyncassertion seen in #8090's CI.expectRaceOutcome, that checks both outcomes:residualPathsis the home only, the manifest carries nouninstallStartedAt, every child exits 0, and every racing path is listed in the manifest and still exists. A rerun then returns{ status: "removed", residualPaths: [] }and the home is gone.an uninstall refused for a busy lock leaves racing registrations recorded for a rerunforces the refused path. It calls uninstall while the test still holds the lock, right after opening the gate, assertsrefused, and runs the same helper. Both tests share aspawnGatedChildrensetup that is the existing barrier code, unchanged.src/is untouched.Closes #8379
Verification
All runs used Bun 1.4.4 on Linux (Ubuntu 24.04).
Reproduction on unchanged
dev3372695: a copy of the original race test that calls uninstall before releasing the held lock fails the same way CI did:With this change,
bun test tests/config/config-ownership-concurrent-record.test.ts -t "racing|refused for a busy lock"passes both tests:Run 25 times in a row: 25/25 passed.
Current head
3d09cccf, rebased ontodevde0914a1:bun test tests/config/config-ownership-concurrent-record.test.ts: 60 pass, 0 fail. This includes the two testsdevadded to the file.bun run typecheck && bun run structure:check && bun run privacy:scan && OCX_TEST_MAIN_TIMEOUT_MS=3600000 bun run test --parallel=4 --timeout 30000: exit 0.tests/update/update-orchestrated-entry.test.ts(npm child fences identity, deadline and sync before mutation...), which timed out at its 90 s budget on a heavily shared host. That file passes on its own on this head (10 pass, 0 fail), and the full rerun above passed.Checklist
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
Required local validation passed; commands, results, and any full-suite exception are documented.
I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Summary by CodeRabbit