Repository navigation
fix(run-tests): keep suites off the optional git index lock - #722
Merged
dmlguq456 merged 2 commits intoOct 21, 2026
Merged
Conversation
build_isolated_env() rebuilds the suite environment from scratch, which dropped the GIT_OPTIONAL_LOCKS=0 that dispatched workers run with. A suite descendant's refreshing `git status` then took the optional index lock on the real checkout, and the suite-end SIGKILL left a holderless index.lock that refused the worker's next `git add` (rt-0c8fb880abc841b7 owner ended BLOCKED on 2026-10-21). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The runner now exports GIT_OPTIONAL_LOCKS=0, so the register call's inherited env carried it and the assertion that only `start` sets it failed in CI shard 6. Clear the variable for the duration of the call. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
tools/run-tests.pybuild_isolated_env()now setsGIT_OPTIONAL_LOCKS=0. The env is rebuilt from scratch (only PATH/LANG/LC_ALL/TZ pass through), so it dropped the setting dispatched workers run with (core/OPERATIONS.md, git index-lock section). Every profile layers on this function, so installed-layout and ci-like get it too.git statusleaves.git/indexuntouched (same inode and mtime).Why
On 2026-10-21 the execute worker of route rt-0c8fb880abc841b7 ran
tools/run-tests.pyfrom 03:44:01Z to 03:47:05Z. At 03:44:41Z a 0-byte, holderlessindex.lockappeared on the real task worktree, so the worker's nextgit addfailed with "File exists" and the owner ended BLOCKED. A suite descendant'sgit statuswas refreshing the index when the suite-end cleanup SIGKILLed it.Test
tools/run-tests.py --select tools/run_tests.test.py --select utilities/git_index_lock_consumers.test.py: PASS=2, fingerprint unchanged (7b9040f1656f0fe8).git statuson a stat-dirty file rewrites the index (inode changes). With=0it does not.🤖 Generated with Claude Code