Skip to content

Fix the main CI unit test breaks from the sessions providers double and leaked question carousels - #346643

Merged
Bryan Chen (bryanchen-d) merged 2 commits into
mainfrom
copilot/vscode/session-providers-test-doubles
Nov 6, 2026
Merged

Bryan Chen (bryanchen-d) merged 2 commits into
mainfrom
copilot/vscode/session-providers-test-doubles

Conversation

@bryanchen-d

Copy link
Copy Markdown
Collaborator

Main CI has been red since 493783 (3bd71c378f). It has 10 Electron and Chromium unit failures on Linux, Windows and macOS, tracked in microsoft/vscode-engineering#4490. There are two separate test breaks.

1. this.event is not a function (Chat window changeset actions, Sessions chat window provider: 6 failures).
#346419 (fbdefe8df36) made sessionAgentMerge observe ISessionsProvidersService.onDidChangeProviders. The ISessionsProvidersService doubles in chatWindowChangesetActions.test.ts and sessionsChatWindowProvider.test.ts only stub getProvider. So when agentMergeActions is loaded in the same renderer, binding the session action context keys throws. The fix adds onDidChangeProviders: Event.None to both doubles.

2. Sessions - Headers (2) and Workbench - Titlebar Part (2) geometry failures.
These aren't caused by #346419. In chatQuestionCarouselPart.test.ts, teardown removed only the last carousel a test created. #346600 (83b2d78545b) added tests that create several carousels in a loop, so the extra ones stayed in document.body. A probe run right after the suite found 2 leftover .chat-question-carousel-container elements, making body 131px tall. That pushed every later fixture down, which flips Headers' drag-buffer hit test (blocked: true) and Titlebar's compact-menu direction (opensDownward: false). The fix makes createWidget register the removal of every carousel it creates.

The WebKit-only carousel layout failures from #346600 are not part of this PR.

Validation

  • Electron unit tests, --runList with agentMergeActions.test.ts plus the 4 failing suites:
    • before: 5 failures, all from this.event
    • after: 76 passing, 3 of 3 runs
  • Electron unit tests, --runList with the carousel suite then Headers and Titlebar:
    • before: Headers 2 and Titlebar 2 fail with the same diffs as CI, and they pass when run without the carousel suite
    • after: both pass, 2 of 2 runs
    • 3 carousel Layout tests time out locally with and without this change. They pass in CI.
  • def 111 Linux-only proof 493799 on the first commit: the 6 this.event failures are gone, and only Headers 2 and Titlebar 2 remain. Proof 493806 on this head is running.
  • tsc --noEmit is clean for the touched files.

Authored with Copilot

Copilot AI balanced review requested due to automatic review settings November 6, 2026 20:44

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

No active review issues remain, though tests were not independently rerun.

No open issues 🎉

What changed in this PR

This PR fixes two test-isolation problems behind main CI failures without changing production behavior.

Changes:

  • Adds onDidChangeProviders: Event.None to two Sessions provider test doubles to support session action context-key subscriptions.
  • Registers DOM cleanup for every question carousel created by the test helper, preventing leftover widgets from disrupting later layout tests.

No actionable findings remain. Tests were not independently rerun; WebKit-only carousel layout failures remain outside this PR’s scope.

File Description
src/​vs/​workbench/​contrib/​chat/​test/​browser/​widget/​chatContentParts/​chatQuestionCarouselPart.test.ts Removes every created carousel during disposal instead of only the last one.
src/​vs/​sessions/​contrib/​chatWindow/​test/​browser/​sessionsChatWindowProvider.test.ts Adds the provider-change event to the service double.
src/​vs/​sessions/​contrib/​chatWindow/​test/​browser/​chatWindowChangesetActions.test.ts Imports Event and supplies the missing provider-change event stub.

Review effort: Balanced

@rzhao271
Raymond Zhao (rzhao271) marked this pull request as ready for review November 6, 2026 20:53
#346419 made sessionAgentMerge observe ISessionsProvidersService.onDidChangeProviders. The chat window test doubles only stubbed getProvider, so binding session action context keys threw 'this.event is not a function' whenever agentMergeActions was loaded in the same renderer.

Co-authored-by: Copilot <[email protected]>
Tests that create several carousels removed only the last one in teardown, so the others stayed in the page. Since #346600 they add about 130px above every later fixture, which broke the drag-buffer tests of Sessions - Headers and the compact menu direction tests of Workbench - Titlebar Part on main.

Co-authored-by: Copilot <[email protected]>

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

No active review issues block the test-only updates to provider doubles and carousel cleanup.

No open issues 🎉

Review effort: Balanced

@bryanchen-d
Bryan Chen (bryanchen-d) merged commit 9beeead into main Nov 6, 2026
53 checks passed
@bryanchen-d
Bryan Chen (bryanchen-d) deleted the copilot/vscode/session-providers-test-doubles branch November 6, 2026 21:14
@vs-code-engineering vs-code-engineering Bot added this to the 1.146.0 milestone Nov 6, 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.

4 participants