Skip to content

test: keep the real pointer out of Electron unit test windows on Windows and macOS CI - #347949

Open
Bryan Chen (bryanchen-d) wants to merge 1 commit into
mainfrom
copilot/vscode/windows-pointer-leave
Open

Bryan Chen (bryanchen-d) wants to merge 1 commit into
mainfrom
copilot/vscode/windows-pointer-leave

Conversation

@bryanchen-d

Copy link
Copy Markdown
Collaborator

Fixes a Windows-only PR CI flake in Artifact Integration Presentation > list rows float their item actions, which run on that item without opening it or closing the panel. It failed on 6 unrelated PRs in the last 48 hours, always on Windows / Electron-Unit and never on Linux or in Browser-Unit:

after: [ ..., { label: 'Build', visible: true, trailing: true, centered: true } ]   // expected visible: false

Mechanism

On CI the Electron unit test window is shown with showInactive() so Windows doesn't throttle its animation frames. A shown window also receives the real desktop pointer. The item actions in that list are shown for rows matching :hover, :focus-within, .focused or .selected. When the runner's cursor rests over the window and Windows delivers mouse moves, which happens as the parallel workers' windows open and close, the second ("Build") row gets :hover after the list re-renders, so its actions show even though it isn't focused. Worker windows cascade, so whether the cursor lands on that row varies from run to run.

Linux had the same problem under Xvfb, and #346645 fixed it by moving the pointer off the window after every top-level suite. Windows wasn't covered.

Change

On CI outside Linux, the test window ignores OS mouse events (setIgnoreMouseEvents(true)). Tests drive input through DOM events or sendInputEvent, which still reach the page. Linux keeps the existing per-suite pointer reset.

Validation

Local repro on Windows, with the CI window mode (GITHUB_WORKSPACE set), the test window kept on top as on a runner, and the cursor moving over the Build row:

  • main: failed 2 of 3 runs, with the exact CI diff above. With the cursor elsewhere on the same window it passes.
  • this change: 9 of 9 runs pass.
  • Broader CI-mode run with this change (vs/base/test/browser, sessions and webview browser tests): 10,520 passing, 0 failing.

Authored with Copilot

Copilot AI balanced review requested due to automatic review settings November 12, 2026 17:35

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 review identifies no active issues with the CI-only pointer-event suppression change.

No open issues 🎉

What changed in this PR

Reduces pointer-induced flakes in Electron unit tests on Windows and macOS CI by preventing the real desktop pointer from triggering hover states in test windows.

Changes:

  • Makes non-Linux CI test windows ignore OS mouse events while preserving DOM and sendInputEvent input.
  • Keeps Linux’s existing per-suite pointer reset unchanged.
  • Documents the platform-specific handling.
File Description
test/​unit/​electron/​index.js Adds CI-only mouse-event suppression for non-Linux test windows.

Review effort: Balanced

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 are reported for the change intended to reduce pointer-induced flakiness in non-Linux CI tests.

No open issues 🎉

Review effort: Balanced

…ows and macOS CI

CI shows the test window (showInactive) so animation frames are not throttled, which also lets it receive the
real desktop pointer. When the pointer rests over the window and Windows delivers mouse moves, `:hover` applies
to whatever a test renders under it. That made `Artifact Integration Presentation > list rows float their item
actions...` fail on Windows PR CI: the unfocused "Build" row showed its actions because it was hovered.

Ignore OS mouse events on the CI test window outside Linux. Tests use DOM events or sendInputEvent, which still
reach the page. Linux keeps moving the pointer off the window between suites.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 04b046a4 Current: ac54dfb7

Changed (1)

sessions/artifactIntegrations/PullRequestCommentsInformation/Light
Before After
before after

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 for the CI pointer-isolation change.

No open issues 🎉

Review effort: Balanced

@bryanchen-d
Bryan Chen (bryanchen-d) marked this pull request as ready for review November 16, 2026 19:04

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.

2 participants