jkleinsc

#55726: test: deflake desktopCapturer moveAbove spec and disable retries

Merged
Created: Nov 10, 2026, 4:09:52 PM
Merged: Nov 16, 2026, 12:56:43 PM
4 comments
Target: main

Description of Change

Refs #55393.

desktopCapturer > moveAbove should move the window at the requested place sometimes failed on windows-arm64 at the final z-order check, and only passed because vitest retried it.

The test assumed its four windows were the first four sources getSources() returns. That breaks when another window is on top. It also breaks on Windows when one of the test's windows doesn't answer WM_NULL within 50ms and is left out of the listing. The test also relied on fixed 2s sleeps after each move.

This PR:

  • Keeps only the test's own windows from each getSources() listing, and lists again until all of them are present.
  • Waits for focus before each moveAbove() call, so the raise from focus() can't land after the move and undo it.
  • Polls for the final stacking order, up to 10s, instead of sleeping 2s per move.
  • Sets retry: 0 on the whole desktopCapturer suite, so future flakes fail instead of being hidden by retries.

Ran spec/api-desktop-capturer.spec.ts locally on macOS and it passes.

Checklist

  • PR description included
  • tests are changed or added
  • PR release notes describe the change in a way relevant to app developers

🤖 Generated with Claude Code

Notes: none

Backports

44-x-y
Pending
Waiting for a manual backport
45-x-y
Pending
Waiting for a manual backport
46-x-y
Merged
PR Number
#55846
Merged At
Nov 16, 2026, 2:26:01 PM
Released In
v46.0.0-alpha.11
Release Date
Nov 16, 2026, 3:00:23 PM

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron