You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test: restore worktree Git spies after each case - #29558
Stop three worktree tests from leaving a fake Git runner installed for later tests.
What Changed
Register per-test restoration immediately after creating each of three Git spies. The two runtime clone regressions keep their real Git configuration, origin checks and assertions. No product code or test cases are removed.
Why
Under shuffled order, an earlier empty-output Git spy made a newly written submodule file appear empty and prevented a completed clone's origin from being verified. Both failures reproduce on the unchanged parent. Restoring the spies at the producing tests fixes isolation without weakening clone behavior or resetting every shared fixture globally. Per-test completion callbacks run even when an assertion throws.
Linked Issue
Maintainer-requested CI test audit.
Visual Proof
N/A — test-fixture cleanup only; no rendered behavior changes.
Testing
I manually tested these changes locally
Automated tests updated
Linux, background launch, Node24.21.0/Bun1.4.3, one worker. Same seven-suite shuffle104729: parent1554pass/2fail/1skip; repaired1556pass/0fail/1skip. The exact two clone assertions now pass; every existing case remains. Full runtime normal order passes1385cases with the same single skip. Node typecheck, changed quality, lint, formatting and whitespace pass.
Diagnostic local seven-suite command wall: parent33.084s, candidate37.540s (candidate overlapped static checks). This is an isolation repair; these unpaired, differently contended observations establish no speedup. Exact-head full CI and hosted cost will be recorded before merge.
Review
Independent diagnosis traces both failures to un-restored empty-output spies. Independent preservation review approved exact commit f4207cb; every test declaration and assertion is preserved. Production0lines; tests+14/-5 after formatting. Host, SSH, folder-workspace, wire and Git compatibility behavior unchanged.
Agent skill upstream boundary
Not applicable; no upstream skill source copied.
Checklist
Focused change; mechanism, user impact and rationale explained
N/A visual proof explained
Cross-platform/SSH/folder behavior considered
Normal order and independent final review
Exact-head full workflow, separate checks and hosted measurement
Refreshed on main2e97d9aa84 after the independent focus-read repair (#29565). Exact reviewed two-file spy cleanup is unchanged. Fresh final-main shuffled runtime run passes1385cases with the same1skip. Prior seven-suite baseline/candidate controls remain valid because all involved runtime and spy fixture sources are unchanged by the ownership repair. Exact-head full CI and hosted measurement remain required.
Final CI: exactc360c0dd5d full .github/workflows/pr.yml run38878934970 passes aggregate116904066371, all five units, static/typecheck, relay and selection evidence. Current separate checks pass or intentionally skip, including Headless persistence. Actual checkout001d9b1a has exactly the reviewed head tree; baseline549ea6c2 equals main2e97 tree. Five clean report inventories retain exactly12334files and all pass/skip states, zero omissions/errors. Runtime retains1386tests/1skip. Selected module cost24104→25208ms (+4.58%) and summed worker work5951743→6141186ms (+3.18%); no hosted speedup claim. Both use matched LinuxX64/cache/four-worker setup (Node setup/artifact24.19.0, runtime wrapper verification24.21.0, Bun1.4.3). This change earns its value by fixing demonstrated order-dependent false failures.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
📝 Walkthrough
Three runtime tests now retain their Git spies and register restoration with Vitest’s onTestFinished callback. The changes cover branch-name override, missing or non-repository worktree cleanup, and orphan-removal scan-cache invalidation tests.
Priority: ⬇️ Low
Merge Risk:⚪ Minimal · up to c360c
This test-only change restores each Git spy after its case, preventing order-dependent interference. No code-specific merge risk is evident; exact-head full CI is still outstanding.
Pre-merge checks: 5
Check name
Status
Explanation
Docstring Coverage
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Title check
The title clearly and concisely describes the main change: restoring Git spies after each test case.
Description check
The description covers the change, reason, testing, visual proof, review, compatibility considerations, and checklist. The Linked Issue section does not contain an actual issue reference, but the rest…
Full details: Docstring Coverage
Explanation
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files.
Full details: Description check
Explanation
The description covers the change, reason, testing, visual proof, review, compatibility considerations, and checklist. The Linked Issue section does not contain an actual issue reference, but the rest of the description is substantially complete.
✨ Finishing Touches
📝 Generate docstrings
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
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
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.
ELI5
Stop three worktree tests from leaving a fake Git runner installed for later tests.
What Changed
Register per-test restoration immediately after creating each of three Git spies. The two runtime clone regressions keep their real Git configuration, origin checks and assertions. No product code or test cases are removed.
Why
Under shuffled order, an earlier empty-output Git spy made a newly written submodule file appear empty and prevented a completed clone's origin from being verified. Both failures reproduce on the unchanged parent. Restoring the spies at the producing tests fixes isolation without weakening clone behavior or resetting every shared fixture globally. Per-test completion callbacks run even when an assertion throws.
Linked Issue
Maintainer-requested CI test audit.
Visual Proof
N/A — test-fixture cleanup only; no rendered behavior changes.
Testing
Linux, background launch, Node24.21.0/Bun1.4.3, one worker. Same seven-suite shuffle104729: parent1554pass/2fail/1skip; repaired1556pass/0fail/1skip. The exact two clone assertions now pass; every existing case remains. Full runtime normal order passes1385cases with the same single skip. Node typecheck, changed quality, lint, formatting and whitespace pass.
Diagnostic local seven-suite command wall: parent33.084s, candidate37.540s (candidate overlapped static checks). This is an isolation repair; these unpaired, differently contended observations establish no speedup. Exact-head full CI and hosted cost will be recorded before merge.
Review
Independent diagnosis traces both failures to un-restored empty-output spies. Independent preservation review approved exact commit f4207cb; every test declaration and assertion is preserved. Production0lines; tests+14/-5 after formatting. Host, SSH, folder-workspace, wire and Git compatibility behavior unchanged.
Agent skill upstream boundary
Checklist
Refreshed on main2e97d9aa84 after the independent focus-read repair (#29565). Exact reviewed two-file spy cleanup is unchanged. Fresh final-main shuffled runtime run passes1385cases with the same1skip. Prior seven-suite baseline/candidate controls remain valid because all involved runtime and spy fixture sources are unchanged by the ownership repair. Exact-head full CI and hosted measurement remain required.
Final CI: exactc360c0dd5d full .github/workflows/pr.yml run38878934970 passes aggregate116904066371, all five units, static/typecheck, relay and selection evidence. Current separate checks pass or intentionally skip, including Headless persistence. Actual checkout001d9b1a has exactly the reviewed head tree; baseline549ea6c2 equals main2e97 tree. Five clean report inventories retain exactly12334files and all pass/skip states, zero omissions/errors. Runtime retains1386tests/1skip. Selected module cost24104→25208ms (+4.58%) and summed worker work5951743→6141186ms (+3.18%); no hosted speedup claim. Both use matched LinuxX64/cache/four-worker setup (Node setup/artifact24.19.0, runtime wrapper verification24.21.0, Bun1.4.3). This change earns its value by fixing demonstrated order-dependent false failures.