Skip to content

fix(test): make claim-test stub CAS independent of mkdir - #481

Merged
randomparity merged 2 commits into
mainfrom
feat/claim-cas-480
Oct 29, 2026
Merged

randomparity merged 2 commits into
mainfrom
feat/claim-cas-480

Conversation

@randomparity

Copy link
Copy Markdown
Owner

Closes #480.

What this changes

tests/fixtures/quest-log/claim-test.sh's stub gh used mkdir <leaf> as its label-create compare-and-swap. The ubuntu-latest runner image moved from Ubuntu 24.04 to 26.04, where /usr/bin/mkdir is uutils coreutils 0.8.0. That mkdir checks for the leaf and then creates it, so two racing calls both succeed, and the simultaneous-claims rounds failed with exits 0:0.

Reproduction in containers, two mkdir calls racing on one leaf, 2000 trials:

Image mkdir --version both succeeded
ubuntu:26.04 uutils coreutils 0.8.0 1991 / 2000
ubuntu:24.04 GNU coreutils 9.4 0 / 2000

The issue's kernel-mkdir(2) hypothesis does not hold, and pre-creating the parent would not have fixed it.

  • The stub now claims a label with bash's noclobber redirect (set -C), which opens the description file with O_CREAT|O_EXCL. That open is a shell builtin, so no coreutils implementation decides the race.
  • A deliberately racy mkdir shim on the suite's PATH (check, sleep 0.2 s, create; -p passes straight through) makes a regression to a mkdir-based CAS fail the simultaneous-claims rounds on every host, macOS included.
  • .claude-plugin/plugin.json 7.12.3 → 7.12.4.

Production tracker.sh / profiles/github.sh are unchanged; they call the GitHub API and never mkdir.

Verification

  • Red: with the shim and the old stub, macOS fails claim-test: round 1: exits 0:0, expected one 0 and one 6.
  • Green: macOS (bash 3.2) passes; ubuntu:26.04 container passes 5/5 runs.
  • Control: main's unmodified suite in the ubuntu:26.04 container fails 3/3 with the CI error.
  • just ci passed via the pre-push hook on 915ae4b.

Review

Single-pass adversarial review (routed: no change hazards, size S, one PR, not security-relevant; security pass not triggered) returned approve with three notes:

  • medium — the stub comment overclaimed independence from coreutils (mkdir -p still makes the directory): accepted, comment narrowed. The suggested || [[ -d ]] guard was rejected: concurrent mkdir -p tolerates an existing directory, and uutils passed 5/5 container runs.
  • low — the shim comment said "deterministically" and implied coverage of the recover rounds: accepted, reworded.
  • low — a racing reader can see an empty description and take the malformed-conflict branch: rejected with evidence. The asserted exit codes are unchanged, no test checks that payload, and it replaces main's 404 → exit 4 window.

Deferrals: none.

Ubuntu 26.04 runners ship uutils mkdir 0.8.0, which checks for the
leaf and then creates it, so two racing creates both succeeded and the
simultaneous-claims rounds failed with exits 0:0. The stub gh now
claims a label with bash's noclobber redirect, an O_EXCL open of its
description file, and a racy mkdir shim on the test PATH makes any
regression to a mkdir CAS fail on every host.

Closes #480
@randomparity

Copy link
Copy Markdown
Owner Author

Review — PR #481 (issue #480)

  • review depth: single-pass (gauntlet, fresh context) · iterations: 1 · exit: none
  • verdict: approve — 3 notes (1 medium, 2 low), 0 blocking
  • dispositions: medium comment overclaim → accepted-fixed (915ae4b); low shim wording → accepted-fixed (915ae4b); low empty-description window → rejected-with-evidence (no asserted outcome changes)
  • security: not triggered (test fixture only; no trigger in the diff)
  • deferrals: none · follow-up candidates: none · suppressions: none
  • reviewed head: 8d0e5a3; delivered head: 915ae4b (comment-only delta)

@randomparity
randomparity merged commit df9b609 into main Oct 29, 2026
5 checks passed
@randomparity
randomparity deleted the feat/claim-cas-480 branch October 29, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

claim-test: concurrent mkdir CAS race fails intermittently on ubuntu CI

1 participant