Repository navigation
perf: batch Test Explorer test run updates - #346656
Connor Peet (connor4312) merged 21 commits into
Conversation
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Anthony Kim (@anthonykim1)Matched files:
|
There was a problem hiding this comment.
🟢 Approval recommended
The review identifies no active issues that would block approval.
No open issues 🎉
What changed in this PR
This PR improves large Test Explorer runs by reducing extension-host RPC traffic and repeated renderer work in result aggregation and output display.
Changes:
- Batch ordered test registrations, states, messages, and output, flushing at lifecycle boundaries and size limits.
- Cache child state and duration information to avoid repeated scans of large suites.
- Filter unused terminal output markers and add regression coverage for batching, result updates, and disposal.
| File | Description |
|---|---|
src/vs/workbench/contrib/testing/test/common/getComputedState.test.ts |
Tests cached aggregation, duration edge cases, and child changes. |
src/vs/workbench/contrib/testing/test/browser/testResultsOutput.test.ts |
Tests output marker filtering and terminal disposal. |
src/vs/workbench/contrib/testing/test/browser/explorerProjections/treeProjection.test.ts |
Covers redundant scans, result clearing, and duration updates. |
src/vs/workbench/contrib/testing/common/getComputedState.ts |
Uses cached child counts for incremental state and duration updates. |
src/vs/workbench/contrib/testing/browser/testResultsView/testResultsOutput.ts |
Filters unused markers and improves terminal lifecycle handling. |
src/vs/workbench/contrib/testing/browser/explorerProjections/treeProjection.ts |
Avoids redundant recomputation and handles zero durations correctly. |
src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts |
Exposes terminal OSC handler registration. |
src/vs/workbench/contrib/terminal/browser/terminal.ts |
Adds OSC handler registration to the detached terminal interface. |
src/vs/workbench/api/test/browser/extHostTesting.test.ts |
Tests batch ordering, limits, and lifecycle flushing. |
src/vs/workbench/api/common/extHostTesting.ts |
Queues and flushes bounded batches of test-run updates. |
src/vs/workbench/api/common/extHost.protocol.ts |
Defines the batched update payload and RPC method. |
src/vs/workbench/api/browser/mainThreadTesting.ts |
Dispatches received batch entries in order. |
Review effort: Balanced
Connor Peet (connor4312)
left a comment
There was a problem hiding this comment.
awesome thanks!
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved batching defects can drop or misorder test updates, leave invalidated results current, and break error peeks and previously supported byte output.
6 open issues
Handle update errors individually to preserve later updates · New Preserve Buffer and Uint8Array output when batching · New Include failure messages in the batch-size budget · New Flush pending failures before dispatching result-dependent commands · New Flush tracker updates before returning from the controller request · New Flush every tracker associated with a run ID · New
Review effort: Max
Dmitriy Vasyura (dmitrivMS)
left a comment
There was a problem hiding this comment.
Please consider copilot comments
Head branch was pushed to by a user without write access
|
[ai-response] Implemented in f8be26d9f27b.
Validation: 120 affected unit tests pass, along with the full client type check and targeted hygiene/ESLint. For a synchronous 5,000-test counting-proxy workload, strings use 42 update RPCs and Buffer/Uint8Array output uses 41. Buffer output previously used 10,025. These are dispatch counts, not IPC or UI timing measurements. |
|
[ai-review] Review overview 🔴 Changes required Reviewed
The six earlier review threads are addressed in the current source; the overlapping-profile failure above is an additional ordering case. Candidate client build and full single-threaded native client typecheck pass. Runtime acceptance stopped after the confirmed regression: Code OSS UI/performance/leak comparisons, disposable-leak unit suites and Chromium/WebKit execution remain unverified. No approval recommendation is made. |
|
[ai-response] feedback implemented Addressed both findings from the review in 2dfb33e1b87f.
Validation: all 122 affected unit tests pass, targeted hygiene/ESLint passes, and the full native client typecheck passes with Full Code OSS UI/performance/memory and browser-engine acceptance from the review remains outstanding. Upstream CI is pending for this new commit. |
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved batching defects can reorder cross-profile updates, leave queued Markdown command allowlists mutable, and cause unnecessary buffer copying and memory retention.
4 open issues
2 resolved since last review
Review effort: Max
|
Added some more Copilot fixes. |
Flush on run or controller changes and avoid scanning historical test trackers when publishing pending updates.
|
Fixed potential ordering issue with multiple concurrent test runs and simplified batchedRpc a bit. |
8398a4e
into
microsoft:main


Details
Large Test Explorer runs send a separate RPC for each test registration, state change, message and output chunk. Thousands of these messages add work in the extension host and renderer.
Change
Batch ordered updates in
BatchedTestRunRpc, with limits on batch size and payload. Flush pending updates before task completion, coverage, result-reading commands and retirement. Support both string and buffer output, and preserve results when profiles share a run.Performance
5000 Mocha tests
Extension host
Before
After
Renderer
Before
After
CPU profiles captured at
25b632f, before subsequent review fixes.AI disclosure: Model: GPT 6.1 Sol. Worktime: 83 min