Skip to content

fix: memory leak in test results - #333244

Merged
Connor Peet (connor4312) merged 5 commits into
microsoft:mainfrom
SimonSiefke:fix/memory-leak-testResultsViewContent
Sep 1, 2026
Merged

fix: memory leak in test results#333244
Connor Peet (connor4312) merged 5 commits into
microsoft:mainfrom
SimonSiefke:fix/memory-leak-testResultsViewContent

Conversation

@SimonSiefke

Copy link
Copy Markdown
Contributor

Details

Clearing test results left two ownership paths reachable: TestResultsViewContent did not dispose its SplitView, and TestResultService removed completed results without disposing their result-specific stores.

Change

Register the split view with its owning content and track result stores by result so removed and evicted results are disposed deterministically.

Before

When running and clearing test results for 37 cycles, 183 named-function rows remain retained, including output-view UI graphs and one LiveTestResult with its raw output per cycle:

before

After

No more matching test-results leak is detected. The matching 37-cycle result contains zero retained named-function rows.

Test Video

test-video.webm

Copilot AI balanced review requested due to automatic review settings August 28, 2026 20:03

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.

Pull request overview

Fixes test-result memory leaks by disposing UI and result-owned resources deterministically.

Changes:

  • Tracks disposable stores by test result.
  • Disposes stores when results are cleared or evicted.
  • Registers the results view’s SplitView for disposal.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
testResultService.test.ts Verifies cleared results are disposed.
testResultService.ts Manages per-result disposable stores.
testResultsViewContent.ts Registers the split view for disposal.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/vs/workbench/contrib/testing/common/testResultService.ts Outdated

@connor4312 Connor Peet (connor4312) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nice, thanks!

roblourens
roblourens previously approved these changes Aug 31, 2026
Comment thread src/vs/workbench/contrib/testing/common/testResultService.ts Outdated
auto-merge was automatically disabled September 1, 2026 14:34

Head branch was pushed to by a user without write access

@SimonSiefke
Simon Siefke (SimonSiefke) force-pushed the fix/memory-leak-testResultsViewContent branch from b4b2422 to 9f87857 Compare September 1, 2026 14:47
@connor4312
Connor Peet (connor4312) merged commit 4fdf440 into microsoft:main Sep 1, 2026
30 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.137.0 milestone Sep 1, 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.

6 participants