Skip to content

agentHost: run SSH and WSL relay replacement tests in virtual time - #342247

Merged
Alexandru Dima (alexdima) merged 1 commit into
mainfrom
agents/test-perf-remote-relay-backoff
Oct 17, 2026
Merged

Alexandru Dima (alexdima) merged 1 commit into
mainfrom
agents/test-perf-remote-relay-backoff

Conversation

@alexdima

@alexdima Alexandru Dima (alexdima) commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

fyi Connor Peet (@connor4312)


The relay replacement tests only use mocks but waited out the protocol client's 1s real-time reconnect backoff. Run them in virtual time.

Each test drops from ~1s to a few ms.

Part of a series that speeds up unit tests waiting on real time, found from the slow tests in the Linux Electron unit test job. Each change is a separate PR so it can be reverted on its own. Test files only; no assertions changed.

How to test

npm run build-fast -- --client-only
./scripts/test.sh --run src/vs/platform/agentHost/test/electron-browser/sshRemoteAgentHostService.test.ts --run src/vs/platform/agentHost/test/electron-browser/wslRemoteAgentHostService.test.ts

Results on macOS, with only this commit applied on top of 832a728:

  • ./scripts/test.sh --run src/vs/platform/agentHost/test/electron-browser/sshRemoteAgentHostService.test.ts --run src/vs/platform/agentHost/test/electron-browser/wslRemoteAgentHostService.test.ts: 82 passing (30ms)

The relay replacement tests only use mocks but waited out the protocol client's 1s real-time reconnect
backoff. Run them in virtual time.

Each test drops from ~1s to a few ms.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 17, 2026 08:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The narrowly scoped timer changes preserve test synchronization and assertions, with no unresolved findings.

No open issues 🎉

What changed in this PR

Speeds up mocked Agent Host relay replacement tests by advancing reconnect backoff in virtual time.

Changes:

  • Wraps two SSH tests and one WSL test in runWithFakedTimers.
  • Preserves existing assertions and production code.
File Description
src/​vs/​platform/​agentHost/​test/​electron-browser/​wslRemoteAgentHostService.test.ts Converts the late replacement relay test to virtual time.
src/​vs/​platform/​agentHost/​test/​electron-browser/​sshRemoteAgentHostService.test.ts Converts late replacement and independent renderer lease tests to virtual time.

Review effort: Balanced

@alexdima
Alexandru Dima (alexdima) marked this pull request as ready for review October 17, 2026 09:39
@alexdima
Alexandru Dima (alexdima) merged commit 3d9307f into main Oct 17, 2026
50 checks passed
@alexdima
Alexandru Dima (alexdima) deleted the agents/test-perf-remote-relay-backoff branch October 17, 2026 10:13
@vs-code-engineering vs-code-engineering Bot added this to the 1.143.0 milestone Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants