Skip to content

test: disable git auto-maintenance in worktree fixtures - #398

Merged
wesbillman merged 1 commit into
mainfrom
ci-git-cleanup-fix
Sep 29, 2026
Merged

wesbillman merged 1 commit into
mainfrom
ci-git-cleanup-fix

Conversation

@matt2e

@matt2e matt2e commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes an intermittent failure on the "Rust and tool integration" CI lane: could not open '.git/worktrees/sibling/locked' for writing in hooks.test.mjs. It showed up on PR #394 (run 36532405871), and a rerun passed.

Cause: in Git 2.50+, every commit starts maintenance run --auto detached in the background. Its worktree-prune task removes any .git/worktrees/<id> entry that has no gitdir or lock file yet. git worktree add creates 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 false in the two fixture repos that commit and then immediately add a worktree:

  • tests/integration/hooks.test.mjs
  • tests/integration/worktree-icon.test.mjs

These 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

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>
@matt2e
matt2e requested review from a team, comp615 and wesbillman as code owners September 29, 2026 07:27

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@wesbillman
wesbillman merged commit 893c97d into main Sep 29, 2026
20 checks passed
@wesbillman
wesbillman deleted the ci-git-cleanup-fix branch September 29, 2026 13:13
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.

2 participants