This repository was archived by the owner on Sep 2, 2026. It is now read-only.
Make the fixture guard survive concurrent worktree churn - #1284
Merged
Conversation
The guard inspects the current working directory, which on a developer machine or CI runner is a live repository other processes may be adding worktrees to or removing them from. A single transient `git worktree list` failure there threw immediately and failed the entire suite for reasons unrelated to the code under test, blocking two release attempts while ./bin/dmc-test passed 148/148. The throw also discarded the captured output, so the failure reported only that inspection failed: no repository, no exit code, no git output. Extract the inspection into a helper that retries a bounded number of times before failing closed, and include the repository, exit code, and git output in the retained error. Fail-closed safety is unchanged; only transient churn is tolerated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1282.
Problem
tests/worktree-add-lifecycle-fixture-guards.phpfailed inside the release test runner while passing standalone, blockinghomeboy release data-machine-codetwice on code that was fine.Immediately afterward, standalone:
./bin/dmc-test→ 148 passed, both before and after.Cause
The guard seeds its inspection set with the current working directory:
On a developer machine or CI runner that is a real repository which other processes may be concurrently adding worktrees to or removing them from — during this session, an agent-driven cleanup was removing 93 worktrees. A single
git worktree list --porcelainagainst such a repository can fail transiently, and the guard treated any non-zero exit as fatal:So the test was order- and timing-dependent on external state it does not own. The throw also discarded the captured
$output, leaving no repository, exit code, or git message to act on.Change
Extract the inspection into
worktree_lifecycle_fixture_inspect_registry(), which retries a bounded number of times (3, 250ms apart) before failing closed, and reports real evidence when it does.Fail-closed safety is unchanged — a repository that genuinely cannot be inspected still fails. Only transient churn is absorbed.
Verification
Diagnostics and retry both exercised against a non-repository path:
./bin/dmc-test→ 148 tests passed. Target test passes standalone.AI assistance disclosure: implemented with Claude Sonnet 4.5 (Anthropic) driving OpenCode via the Kimaki Discord bridge. The model hit this failure while releasing v0.72.8, traced it to the cwd-seeded inspection set, made the change, and captured the verification output above. A human directed the work.