Repository navigation
test(config): rerun an uninstall refused by a busy lock in the ownership race test - #8822
Conversation
…the racing test The racing children can hold the ownership lock past the uninstall's 50 ms wait on a loaded runner; the refused run writes nothing, but the test read it as a contract break. Rerun busy refusals and add a case that forces one deterministically.
|
✅ Deterministic PR hygiene checks passed. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Maintainer integration of #8822 at 6eb809e. This repairs the macos 3/4 failure in dev batch run 43832690786 (3c8e1e7):
The windows 9/14 failure in the same run is repaired separately in #8823. One batched |
Summary
Fixes the macOS failure in dev batch run 43832690786 (job 133181708969):
config-ownership-concurrent-record.test.ts> "a registration racing uninstall is either removed or refused, never left unreported" failed atif (codes[i] === 0) expect(existsSync(path)).toBe(false).The race was in the test. In the product,
removeOwnedConfigStatewaits at most 50 ms for the ownership lock and then returnsrefused("could not lock the ownership manifest: … busy …") without writing anything. In the test, the six gated children keep contending for that lock after the barrier releases it, so a loaded runner can make the single uninstall call lose. Every child then records its path and exits 0, the refused uninstall reports only the home directory as residual, and the assertion fails. The failing test ran for 208 ms, about one lock wait plus the children finishing. That busy refusal is reported and leaves no tombstone, so it does not break the #8093 contract. Under the lock, a registration either lands in the snapshot the uninstall removes, is refused by the tombstone (exit 3), or finds the metadata gone and stays unrecorded (exit 2, reported as residual).The test now reruns an uninstall that was refused as busy, the way a user retries. After each busy refusal it asserts that the run left no tombstone. A second case holds the barrier lock through the first uninstall run, so the busy refusal happens on every run instead of depending on scheduling. Both cases keep the original contract assertion and add two checks: the final result is not
refused, and the forced case actually saw a busy refusal. No product code changes.Verification
All test runs used
/usr/bin/lockf -k /tmp/ocx-test.lockand single files only, because the host is under heavy load.removeOwnedConfigStatecall fails at the same assertion and call stack as CI (Expected: false, Received: trueinsidenames.forEach).bun test tests/config/config-ownership-concurrent-record.test.ts: 60 pass, 0 fail.bun test tests/config/config-ownership-concurrent-record.test.ts -t 'racing uninstall'repeated 20 times: 20 pass, 0 fail.bun run typecheck: no type errors.bun test tests/ci-workflows/file-size-ratchet.test.ts,tests/test-layout.test.ts,tests/test-layout-tooling.test.ts: all pass.bun run test:changed, macOS/Windows CI lanes.ci:fullis requested for the PR run.Checklist
Summary by CodeRabbit