Skip to content

test: move the pointer off the window after every top-level suite on Linux Electron - #346645

Merged
Bryan Chen (bryanchen-d) merged 2 commits into
mainfrom
copilot/vscode/test-pointer-leave
Nov 11, 2026
Merged

Bryan Chen (bryanchen-d) merged 2 commits into
mainfrom
copilot/vscode/test-pointer-leave

Conversation

@bryanchen-d

@bryanchen-d Bryan Chen (bryanchen-d) commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Linux Electron unit tests run under Xvfb, where the real pointer rests over the test window. Once a suite activates the window, Chromium applies :hover and sends trusted hover events to whatever a later suite renders under that pointer. That made tests pass alone or in PR CI's sharded runs but fail in def 111's single-page run, and it broke main twice:

Both were the same mechanism, fixed one test at a time. This fixes it in the harness instead.

Change

  • The hover isolation detector, which already reports this state after every top-level suite, now also resets it on Linux Electron. The renderer asks the main process to send the page a mouseLeave (webContents.sendInputEvent), so Chromium treats the pointer as outside the window until it really moves. Under Xvfb, it never does.
  • IIsolationDetector.reset can now return a promise, and the isolation check's after all hook awaits it, so the next suite starts after the pointer has left.
  • Other platforms and the browser runner don't change. There, the real pointer isn't over the page.

The per-test workarounds from #345320 and #346048 stay for now. They can be removed in a follow-up once this has run on main for a while.

Validation

Authored with Copilot

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

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.

🟡 Changes recommended

The asynchronous reset contract lacks regression coverage proving that teardown waits for reset completion and that a rejected reset records a finding without preventing later detectors from running.

1 open issue
What changed in this PR

This PR centralizes hover isolation in the Electron test harness to prevent the stationary Xvfb pointer from affecting later Linux test suites. Existing per-test workarounds remain unchanged.

Changes:

  • Add a Linux-only hover reset after each top-level Electron suite.
  • Send a mouseLeave event through the main process.
  • Allow asynchronous isolation resets and await their completion before continuing.
File Description
test/​unit/​electron/​renderer.js Connects the Linux hover detector reset to the main-process handler.
test/​unit/​electron/​index.js Adds the handler that sends mouseLeave to the requesting page.
src/​vs/​base/​test/​browser/​isolationCheck.ts Supports and awaits asynchronous resets while recording failures.

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 remain for the Linux Electron hover-state cleanup and asynchronous isolation-reset changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

…Linux Electron

Under Xvfb, the real pointer stays over the test window once a suite activates it, so :hover applies to whatever a later suite renders there. That caused the sticky request bubble (#344806) and Part Grid (#345683) main CI breaks. The hover detector now resets by sending mouseLeave to the page, and detector resets may be async.

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

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 recorded for the Linux Electron hover-isolation fix.

No open issues 🎉

Review effort: Balanced

@bryanchen-d

Copy link
Copy Markdown
Collaborator Author

Linux / Electron-Smoke (shard 3/3) failed in Agents Window (SSH Dev Container AgentHost) › Starts and reopens a Dev Container session over SSH (locator.fill: Timeout 30000ms exceeded, job 130100731819). That's a known smoke flake on other PRs today, and it's unrelated to this change, which only touches the unit-test isolation check and the Electron unit-test runner. I've rerun the failed jobs on the same signed head.

Co-authored with Copilot

@bryanchen-d

Copy link
Copy Markdown
Collaborator Author

The rerun failed Linux / Electron-Smoke (shard 3/3) again, this time on a different known flake, Chat Sessions › Test Local session (job 130110609807), which #347394 fixes. Neither flake touches this PR's files. I've rerun once more on the same signed head.

Co-authored with Copilot

@bryanchen-d
Bryan Chen (bryanchen-d) marked this pull request as ready for review November 11, 2026 00:42
@bryanchen-d
Bryan Chen (bryanchen-d) merged commit 17c1ca6 into main Nov 11, 2026
135 of 140 checks passed
@bryanchen-d
Bryan Chen (bryanchen-d) deleted the copilot/vscode/test-pointer-leave branch November 11, 2026 00:45
@vs-code-engineering vs-code-engineering Bot added this to the 1.147.0 milestone Nov 11, 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.

3 participants