test: disable git auto-maintenance in worktree fixtures - #398
Conversation
Git 2.50+ commits detach `maintenance run --auto`, whose worktree-prune task removes a `.git/worktrees/<id>` entry that has no gitdir or lock file yet. `git worktree add` creates that directory before writing its lock, so a prune landing in between deletes it and the add fails with "could not open '.git/worktrees/sibling/locked' for writing". This flaked once on the "Rust and tool integration" lane in hooks.test.mjs (PR #394, run 36532405871); a rerun passed. Set `maintenance.auto false` in the two fixture repositories that commit and then immediately add a worktree. Disposable probe repos gain nothing from background maintenance, and the local config covers every later fixture commit, including probes driven through installed hooks. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Matt Toohey <contact@matttoohey.com>
wesbillman
left a comment
There was a problem hiding this comment.
Star Lord automated source review (via Wes’s account)
No actionable findings in this two-file fixture change.
Both maintenance.auto=false writes target the disposable fixture repository and precede its first commit and linked-worktree creation (hooks.test.mjs:53, worktree-icon.test.mjs:47). The hook installer changes worktree-specific hook configuration without removing this shared repository setting. Existing assertions, failure/fallback cases, and cleanup are unchanged; production behavior and UI success/cancel/error/retry focus transitions are not modified.
Reviewed the public description, seven-line diff, and commit message/attribution; no public-material privacy issue identified in that scope. The description contains no attached images.
Evidence and limits: source-only review of immutable, blob-verified files; no local PR code, tests, builds, or apps executed. One hosted CI snapshot reports “Rust and tool integration” and “CI required” successful for this head. The tool-job log checks out the merge of the pinned head/base, using Ubuntu and Git 2.55.0: node --test tests/integration/*.test.mjs reports 158 tests, 156 passed, 2 macOS-only skips, 0 failures; 136.64 s elapsed (job: 270 s), approximately 386.88 s summed passing-test durations. The slowest reported test is the controller Cargo/defaults probe at 90.71 s, not either changed fixture. This is hosted evidence, not a local reproduction or proof that the race is eliminated. No comparable before/after fixture setup/execution timings were supplied, so performance regression and flake-rate claims remain unverified; macOS-only behavior remains untested by this Linux run.
Head: ac822ab7ee2a914667e389a755aa22f998b28e19
Base: c6b47a5837fd8912dc84d98bb959714a23d70818
Non-blocking COMMENT review only; not approval or merge authorization.
Summary
Fixes an intermittent failure on the "Rust and tool integration" CI lane:
could not open '.git/worktrees/sibling/locked' for writinginhooks.test.mjs. It showed up on PR #394 (run 36532405871), and a rerun passed.Cause: in Git 2.50+, every commit starts
maintenance run --autodetached in the background. Its worktree-prune task removes any.git/worktrees/<id>entry that has no gitdir or lock file yet.git worktree addcreates that directory before it writes the lock. So if the prune runs in that gap, it deletes the directory and the add fails.Fix: set
maintenance.auto falsein the two fixture repos that commit and then immediately add a worktree:tests/integration/hooks.test.mjstests/integration/worktree-icon.test.mjsThese throwaway repos get nothing from background maintenance. The setting is local repo config, so it also covers later fixture commits, including the ones made through installed hooks.
🤖 Generated with Claude Code