Skip to content

continuum-git: tests that spawn git and tests that judge a live git run one at a time (card bd3f9f12) - #5530

Merged
joelteply merged 1 commit into
canaryfrom
bd3f9f12/continuum-git-a-git-spawned-by-one-test
Oct 27, 2026
Merged

joelteply merged 1 commit into
canaryfrom
bd3f9f12/continuum-git-a-git-spawned-by-one-test

Conversation

@joelteply

@joelteply joelteply commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Why

My #5525 added a real-git test to continuum-git that makes CI fail intermittently, so every PR sharing that job is at risk until this lands. #5528 just hit it: run 40512737561, job 122218611279, ubuntu-latest. The failure is index_lock::tests::a_dead_gits_lock_is_found_in_a_clone_and_a_worktree_and_removed, panicking at index_lock.rs:238 with "no git runs in a fresh tempdir".

Cause

  • index_lock::may_work_on counts a git whose working directory can't be read as possibly working in the tree, deliberately: "An unreadable cwd is never evidence of absence."
  • On Linux, a git that is exiting reads that way.
  • A deploy aligns every present submodule checkout; tracker and consumer share one dirty predicate (card a1e1af51) #5525's submodules test spawns git processes in the same test binary, concurrently. The dead-lock test then saw "a git that may own it", held the lock, and failed.
  • macOS reads other processes' working directories, so it never reproduced there: 0 of 12 runs of canary failed.

Change

continuum_git::GIT_PROCESSES, a #[cfg(test)] mutex held by both the git-spawning test and the live-git test, so no test-spawned git is alive while the judgment runs. Production code is unchanged.

Verified (enrico, 2026-10-27, head 993bf7e)

  • cargo test -p continuum-git --lib: 5 passed, three runs in a row.
  • Ratchets against origin/canary: exit 0.
  • The failing interleaving needs Linux's unreadable working directory, so the fix is proven by reasoning plus the CI log, not by a local reproduction. CI on this PR runs the Linux job.

Card bd3f9f12.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

…un one at a time (card bd3f9f12)

#5525's real-git submodule test spawns git in the same test binary as
index_lock's dead-lock test. may_work_on counts a git whose cwd cannot be read
as possibly working in the tree, and on ubuntu an exiting git reads that way, so
the lock was Held: 'no git runs in a fresh tempdir' (index_lock.rs:238, run
40512737561, ubuntu-latest). A crate test mutex, GIT_PROCESSES, is held by both.
macOS reads other processes' cwd and never reproduced it (0/12 on canary); with
the mutex, 3/3 local runs pass.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply

Copy link
Copy Markdown
Contributor Author

PASS source review at 993bf7e. The test-only mutex covers the entire synchronous git-spawning fixture and the live-process scanning fixture, removing their intra-binary race without weakening production lock ownership checks. Unrelated external git processes remain outside this test mutex. Independently verified all checks passing or intentionally skipped, including Linux continuum-git and the completed core gate. No local build beside active serving.

@joelteply
joelteply merged commit 1f2c3f6 into canary Oct 27, 2026
18 checks passed
@joelteply
joelteply deleted the bd3f9f12/continuum-git-a-git-spawned-by-one-test branch October 27, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant