Repository navigation
Turn off git auto maintenance in every scenario - #268
Merged
Merged
Conversation
A newer git detaches auto maintenance into the background after a commit, where it can still write into .git/objects once the command has returned. A test script that then deletes its temporary clone, or clones the origin again, races it. Closes #263 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…on main at 362b9ca; fix main first) 2026-10-01T13:25:01Z, host thirdshift. Uncommitted work at the time of failure is included in this commit.
JacobStephens2
marked this pull request as draft
October 1, 2026 13:25
4 tasks
…seen, the harness tests' header for both subjects Co-Authored-By: Claude Opus 5.5 <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
Every scenario's gitconfig now turns git's auto maintenance off, so no git command in a scenario (by thirdshift, a fake, or a script) leaves a background writer behind.
A comment on
write_gitconfigexplains the race. Thebase_moves_onscripts andsrc/are untouched.Seam tested:
Scenario(the harness's public interface), throughlaunch_git, intests/harness.rs.Was the cause confirmed on git 2.47 or later?
Partly. Background maintenance is confirmed as a writer that outlives its command and breaks the clone-and-delete script on git 2.55, and the setting stops it. The exact
rm: ... Directory not emptyfrom the CI run was not reproduced, so that symptom is still inferred.These measurements are from the first Run on this branch, which built git 2.51.0 and 2.55.0 from source (the machine has 2.43.0) and looped the
base_moves_onscript (clone, commit, push,rm -rf) underbash -eagainst a bare origin with the scenario's gitconfig. The builds were deleted afterwards, and the loops were not repeated in the Run that wrote this body.git clonelosing a race with the origin's maintenance after the push, not therm -rf:fatal: failed to copy file to '<clone>/.git/objects/42/c8bb…': No such file or directory(4 on loose objects, 1 onobjects/bitmap-ref-tips_…).GIT_TRACE=1on 2.51 showsgit maintenance run --auto --quiet --detachstarted after a commit and on the receiving side of a push; withmaintenance.auto=falseit is not started.rm -rfonly) did not fail in 1,500 loops on 2.55 either way, so the clone's own maintenance racingrm -rfwas not seen.Evidence
a_scenarios_gitconfig_turns_auto_maintenance_offfails:git ["config", "--get", "maintenance.auto"] failedAfter: it passes, asserting
maintenance.autoisfalseandgc.autois0with the scenario'sHOME.cargo testat the branch head, merged withmainat 9b65352: 29 test binaries, 625 passed, 0 failed, on git 2.43.0. No test was weakened, skipped or retried.cargo fmt --checkandcargo clippy --all-targetsare clean.PATH; that was not repeated here.testandtest-macoschecks on this PR werethe_binary_never_links_opensslintests/packaging.rs, which failed onmainat 362b9ca too.mainis green again and is merged into the branch.Unaddressed findings
Addressed from this review: the
write_gitconfigcomment stated therm -rffailure as fact; it now leads with the re-clone failure that was seen and says therm -rfone "can" happen. Thetests/harness.rsheader now names the harness as its one subject, with the waits and the gitconfig under it.Standards
write_gitconfig. Skipped: the test's literals are its independent statement of what to expect; a shared constant would make it pass by construction. The reviewer advised against acting on it too.write_gitconfigcomment is looser than "the fake agent's script". Skipped: the scripts at issue are also run by the fakegh's hooks (on_ci_read), so the narrower term would be wrong.Spec
git_outputsetsHOMEbut does not clear the environment, so aGIT_CONFIG_GLOBALorGIT_CONFIG_COUNTexported in a developer's shell would replace the scenario's gitconfig for the harness's own git calls. Skipped: predates this change, does not affect CI, and would bypass the identity and the insteadOf rule too. thirdshift, the fakes and their scripts run with a cleared environment and are covered.tests/update.rsrunsthirdshift updatewithHOMEset to an empty directory. Skipped: predates this change; that test expects a refusal before any git command and has no clone-and-delete script.tests/release.rs,tests/site_deploy.rsand the unit tests insrc/git.rsandsrc/worktree.rsbuild repositories withGIT_CONFIG_GLOBAL=/dev/nulland noScenario, so auto maintenance stays on there. Skipped: the reviewer raised it as outside the spec, which scopes the change to the gitconfig the harness writes for every scenario. It is the same hazard class and may deserve its own issue if those tests ever flake this way.Merge Danger
Door: two-way
Test harness only; reverting is one commit.
Blast Radius: tests
Repositories in scenarios never auto-pack. They live for one test, so nothing depends on it.
Closes #263
🤖 Generated with Claude Code