Repository navigation
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
Open
Bryan Chen (bryanchen-d) wants to merge 1 commit into
Bryan Chen (bryanchen-d) wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟢 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
sendInputEventinput. - 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
Bryan Chen (bryanchen-d)
requested a review
from Ladislau Szomoru (lszomoru)
November 16, 2026 18:26
Bryan Chen (bryanchen-d)
force-pushed
the
copilot/vscode/windows-pointer-leave
branch
from
November 16, 2026 18:26
aa7ed49 to
5d28077
Compare
…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>
Bryan Chen (bryanchen-d)
force-pushed
the
copilot/vscode/windows-pointer-leave
branch
from
November 16, 2026 18:52
5d28077 to
167fdca
Compare
Contributor
Bryan Chen (bryanchen-d)
marked this pull request as ready for review
November 16, 2026 19:04
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 onWindows / Electron-Unitand never on Linux or in Browser-Unit: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,.focusedor.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:hoverafter 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 orsendInputEvent, which still reach the page. Linux keeps the existing per-suite pointer reset.Validation
Local repro on Windows, with the CI window mode (
GITHUB_WORKSPACEset), 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.vs/base/test/browser, sessions and webview browser tests): 10,520 passing, 0 failing.