Skip to content

testing: release evicted run trackers after their tasks finish - #336409

Open
Russell Lewis (Russe11) wants to merge 3 commits into
microsoft:mainfrom
Russe11:codex/testing-evicted-run-cleanup
Open

Russell Lewis (Russe11) wants to merge 3 commits into
microsoft:mainfrom
Russe11:codex/testing-evicted-run-cleanup

Conversation

@Russe11

@Russe11 Russell Lewis (Russe11) commented Sep 16, 2026 •

Copy link
Copy Markdown

Fixes #336408. Follow-up to #333244's result-store disposal fix.

When completed test history is trimmed, TestResultService now emits the existing removal notification after disposing the removed result. Active runs no longer consume completed-history slots, and a run is protected from eviction during its own completion so extension-host data remains available for later asynchronous lookups such as $getCoverageDetails. A later completed-history event can evict it through the existing $disposeRun lifecycle.

Regression coverage

  • Completed and immediately evicted results emit the expected removal notification.
  • Active runs remain retained beyond the completed-history limit.
  • A run completing against saturated history remains available until a later completion evicts it.
  • Detailed coverage remains callable after task completion and becomes unavailable only after explicit result disposal.

Validation

Based on f80869ac3889f66f437dcbc430b83755ff7d0807; latest patch commit 7097eb8.

On macOS arm64 with Node 24.18.0:

npm run eslint -- src/vs/workbench/contrib/testing/common/testResultService.ts src/vs/workbench/contrib/testing/test/common/testResultService.test.ts src/vs/workbench/api/common/extHostTesting.ts src/vs/workbench/api/test/browser/extHostTesting.test.ts
npm run transpile-client
npm run test-browser-no-install -- --browser chromium --run src/vs/workbench/contrib/testing/test/common/testResultService.test.ts --run src/vs/workbench/api/test/browser/extHostTesting.test.ts
npm run typecheck-client

All commands passed; the two complete browser suites reported 47 passing tests.

Copilot AI balanced review requested due to automatic review settings September 16, 2026 12:02
@Russe11

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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 lifecycle fix is coherent, disposal ordering is safe, and relevant edge cases have regression coverage.

Pull request overview

Fixes retained extension-host test-run trackers when result history evicts entries.

Changes:

  • Emits removal events for evicted results.
  • Defers tracker disposal until active tasks become idle.
  • Adds regression coverage for eviction, re-entry, and grouped tasks.
File summaries
File Description
testResultService.ts Notifies consumers after eviction disposal.
extHostTesting.ts Safely defers and coalesces tracker cleanup.
testResultService.test.ts Covers removal notifications during eviction.
extHostTesting.test.ts Covers deferred and re-entrant disposal.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0
  • Review effort level: Balanced (auto)

Note

Copilot is running an experiment and ran this review at Balanced.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@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.

Test runs cannot be disposed when their tasks end. Run information is needed for later async lookups, e.g. via $getCoverageDetails

@Russe11

Copy link
Copy Markdown
Author

Hi Connor Peet (@connor4312) — I addressed the change request in 7097eb8 by preserving a run through its own completion and evicting it only on a later completed-history event. I also added saturated-history and post-completion coverage lookup regressions. Could you please re-review?

This branch has not been deployed

No deployments
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.

Testing: automatic result eviction leaves extension-host run trackers retained

4 participants