Skip to content

chat: run implicit context selection debounce tests in virtual time - #342249

Merged
Alexandru Dima (alexdima) merged 1 commit into
mainfrom
agents/test-perf-implicit-context-debounce
Oct 17, 2026
Merged

Alexandru Dima (alexdima) merged 1 commit into
mainfrom
agents/test-perf-implicit-context-debounce

Conversation

@alexdima

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

Copy link
Copy Markdown
Member

cc Henning Dieterichs (@hediet)

Both tests slept a real 510ms per step to get past the 500ms selection debounce. Run them in virtual time; the ordering they check is unchanged.

Each test drops from ~1.5s 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/workbench/contrib/chat/test/browser/attachments/chatImplicitContext.test.ts

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

  • ./scripts/test.sh --run src/vs/workbench/contrib/chat/test/browser/attachments/chatImplicitContext.test.ts: 11 passing (2s)

Both tests slept a real 510ms per step to get past the 500ms selection debounce. Run them in virtual
time; the ordering they check is unchanged.

Each test drops from ~1.5s 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 narrow test-only changes preserve the tested ordering and assertions, with no unresolved findings.

No open issues 🎉

What changed in this PR

Speeds up two chat implicit-context debounce tests using the existing virtual-time helper.

Changes:

  • Wraps both tests in runWithFakedTimers.
  • Preserves assertions, timing intervals, and production behavior.
File Description
src/​vs/​workbench/​contrib/​chat/​test/​browser/​attachments/​chatImplicitContext.test.ts Replaces real-time waits with virtual scheduling in two tests.

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 9a59550f Current: adbdca06

Changed (1)

sessions/chatCompositeBar/MixedStatuses/Light
Before After
before after

@alexdima
Alexandru Dima (alexdima) merged commit db6f70f into main Oct 17, 2026
84 of 85 checks passed
@alexdima
Alexandru Dima (alexdima) deleted the agents/test-perf-implicit-context-debounce branch October 17, 2026 16:25
@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