Skip to content

fix(run-tests): keep suites off the optional git index lock - #722

Merged
dmlguq456 merged 2 commits into
mainfrom
autopilot-code-tools-run-tests-py-bui-4a7346a666
Oct 21, 2026
Merged

dmlguq456 merged 2 commits into
mainfrom
autopilot-code-tools-run-tests-py-bui-4a7346a666

Conversation

@dmlguq456

Copy link
Copy Markdown
Owner

Summary

  • tools/run-tests.py build_isolated_env() now sets GIT_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.
  • New regression test: with the isolated env, a refreshing git status leaves .git/index untouched (same inode and mtime).

Why

On 2026-10-21 the execute worker of route rt-0c8fb880abc841b7 ran tools/run-tests.py from 03:44:01Z to 03:47:05Z. At 03:44:41Z a 0-byte, holderless index.lock appeared on the real task worktree, so the worker's next git add failed with "File exists" and the owner ended BLOCKED. A suite descendant's git status was 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).
  • Checked by hand: without the variable, git status on a stat-dirty file rewrites the index (inode changes). With =0 it does not.

🤖 Generated with Claude Code

dmlguq456 and others added 2 commits October 21, 2026 13:05
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>
@dmlguq456
dmlguq456 merged commit 3e85db5 into main Oct 21, 2026
24 of 26 checks passed
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.

1 participant