Repository navigation
test(host-git-repo-exec): make the nested-repo fixture fire without racy timing - #25571
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: this is a test-only fix for a timing flake in the fixture itself, and the new test pins the slow-shard case. [DESIGN-REVIEWED] 47bc250 Description read[DESCRIPTION-READ] 9b110da2d020e31d475d8af39aac47dd4d9cb048975da2dec5ef5bd24c4eadab That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
21c7d6d to
47bc250
Compare
|
Review-ready at head 47bc250: PR Readiness passed (label 🤖 AI-assisted comment 🤖 |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: test (1 file). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: test-only change that makes the nested-repo filter fixture keep the file size so git must hash it, plus a test proving the fixture fires without a racily clean index.
…-deleted test (#26694) The config-deleted case's self-check went inert on two macOS shards (#25374). Both runs merged onto a main from before #25571, whose nested fixture wrote a size-changed x.txt; on a non-racily-clean index that file never reaches the clean filter. Pin that index shape here so the fixture keeps proving the vector fires under slow-shard timing, as the driver test beside it already does. Closes #25374
Problem / Motivation
Goal:
test_probes_see_a_driver_declared_in_a_nested_repopasses every time, in a busy CI shard as well as alone.The test failed once in Backend Tests (3.12, 5) with
AssertionError: fixture is inert: baregit status --porcelainran no marker, on a PR that changed onlywebsite/files. Run alone, it passes.Why it matters
A red that has nothing to do with the PR costs every author a rerun and teaches people to ignore red tests. The liveness check it trips is the guard that keeps the security assertions after it honest.
Not a goal
update_governance's nested-repo probes are correct; only the fixture was flaky.post-index-change, line 600) is PR test(host-git-repo-exec): pin mtime before hook liveness check #25469's work.What changed (motivation → approach → change)
The fixture's planted filter did not always run, so the liveness check failed. No other test leaks state into this one. The cause is timing in the fixture itself.
x.txt"dirty\n", a new size"y\n", the same size.gitattributes, only if its index entry is racily cleanx.txt, every timeGit counts an index entry as "racily clean" when its file was written in the same moment as the index. Only then does it re-hash
.gitattributesand run the filter. In a fast run that is the normal case. In a loaded shard, the gap between writing the file andgit addgrows past that moment, and the filter never runs.A same-size edit with an old mtime leaves git no shortcut: it must hash
x.txtthrough the filter._with_nested_filter_repomakes that edit, and a comment there says why.test_a_nested_repo_with_its_config_deleted_is_refusedchecks the same helper's liveness and gets the same fix.Backwards compatibility
Compatible: test-only change; no product code is touched.
Removes nothing: only a test fixture's file content changes, and a test is added.
Tests
New
test_the_nested_fixture_fires_without_a_racily_clean_indexmoves the nested index's mtime 60 s past.gitattributes, the state a slow shard produces, then requires the filter to fire."dirty\n") the new test fails with the CI error,fixture is inert: baregit status --porcelainran no marker. With the fix it passes.git addmade the original test fail 1 of 3 runs on the old fixture and pass 3 of 3 with the fix.TestNestedRepoDrivers+TestNestedProbeFailures, 20 of 20 runs green.scripts/local-gate.py): 271 passed. Flake ratchet: 64 passed. Semgrep on the diff: 0 findings.Proof: not provable -- test-only change
Manual verification
Measured with a standalone script that builds the same fixture (git 2.50.1): the filter's stdin shows it ran on
.gitattributesalone. A pause of 0.3 s or more beforegit addmade baregit statusinert every time.Related Issues
Closes #25499
Sibling sweep
Swept: git grep -nE '_prove_planted_vector_fires(.*"status"' -- test/
Sibling: test/test_host_git_repo_exec_neutralization.py:1030 -- changed here, through the shared
_with_nested_filter_repofixtureSibling: test/test_host_git_repo_exec_neutralization.py:600 -- tracked in #25469, which pins an mtime for the post-index-change probe
Sibling: test/test_host_git_repo_exec_neutralization.py:723 -- not affected -- fires through core.fsmonitor, which every status runs
Sibling: test/test_host_git_repo_exec_neutralization.py:868 -- not affected -- fires through core.fsmonitor, which every status runs
Sibling: test/test_host_git_repo_exec_neutralization.py:412 -- not affected -- fires through core.fsmonitor, which every status runs
Pattern harvest
Rule candidate: review-prompt
Pattern: a fixture that needs git to hash a file makes a same-size edit with a changed mtime; a size change lets git skip the hash, and "racily clean" timing decides the rest.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)🤖 AI-assisted PR 🤖