Repository navigation
agentHost: fix mis-nested tests in agentHostGitStateService.test.ts - #342262
Merged
Merged
Conversation
Two test() calls were nested inside another test's body, so Mocha never ran them. Close the enclosing tests and dedent the nested ones. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
Both nesting corrections match the stated purpose, with unchanged test logic and no unresolved findings.
No open issues 🎉
What changed in this PR
Restores two previously hidden Agent Host Git state regression tests so Mocha registers them at suite scope.
Changes:
- Corrects test boundaries and indentation.
- Preserves all test setup and assertions; production code is unchanged.
| File | Description |
|---|---|
| src/vs/platform/agentHost/test/node/agentHostGitStateService.test.ts | Fixes nesting of two regression tests. |
Review effort: Balanced
Alexandru Dima (alexdima)
marked this pull request as ready for review
October 17, 2026 11:09
Alexandru Dima (alexdima)
enabled auto-merge (squash)
October 17, 2026 11:09
This was referenced Oct 17, 2026
Ladislau Szomoru (lszomoru)
approved these changes
Oct 17, 2026
Alexandru Dima (alexdima)
added a commit
that referenced
this pull request
Oct 17, 2026
* eslint: require runWithFakedTimers to wrap the whole test body Add `local/code-run-with-faked-timers-whole-test`, which flags `runWithFakedTimers` calls in `src/vs/**/*.test.ts` that wrap only part of a test. Code outside the callback runs on real timers, and the drain after the callback can fire unrelated pending timers (e.g. polls) before the assertions that follow. Allowed: the call is the whole test body, a wrapper helper whose whole body is the call, or an `onHistory` capture (history is delivered only after the drain). Nested calls and calls from hooks are reported too. Existing violations (19 files) are excluded and can be fixed file by file. Co-authored-by: Copilot <[email protected]> * eslint: update runWithFakedTimers baseline after merging main `agentHostGitStateService.test.ts` no longer has partial wraps (#342262). `serverIntegrationTestHelpers.test.ts` spawns a real server process, so only the bounded exit waits run in virtual time; suppress inline with a reason. Co-authored-by: Copilot <[email protected]> * eslint: report unawaited and hook-nested runWithFakedTimers calls A bare `runWithFakedTimers(...)` statement was accepted as a whole test body, although the test can finish before the callback, the drain, and the timer restore run. Report it as `floating`. Calls inside a function nested in a setup/teardown hook were accepted as wrapper helpers; report them as `hook`. Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
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.
fyi Benjamin Christopher Simmonds (@benibenj) we had miss-matched
});in the file which was leading to a pattern likeThe inner tests would never execute, must have been some bad conflict resolution.
Fixes two mis-nested
test(...)calls inagentHostGitStateService.test.ts(introduced in 78ac5ac, #329149). They were declared inside the body of a preceding test, so Mocha silently dropped them:preserves GitHub state updated while a pull request lookup is in flightdoes not capture an empty baseline for a stale branch lookupThe change only closes the enclosing tests, removes the stray closing braces and fixes indentation. No test logic changed.
How to test:
Result: 91 passing, including both previously hidden tests.
npm run eslint -- src/vs/platform/agentHost/test/node/agentHostGitStateService.test.tspassed.