#54261: test: prepare the spec suite for a parallel runner
Merged
Created: Sep 23, 2026, 7:07:45 PM
Merged: Sep 24, 2026, 1:55:24 AM
10 comments
Target: main
Description of Change
Groundwork for running the spec files across several Electron processes at once (the vitest runner itself follows separately). Everything here runs under the current mocha runner; one commit per change.
- BrowserWindow spec groups that were declared with
it()but only wrap otherit()calls becomedescribe(); the inner tests never ran (two macOS expectations they contained are updated or skipped with a FIXME, see the commit). this.retries(n)moves from inside test bodies up to the suite.runCleanupFunctions()runs everydefer()-ed cleanup even when one throws, instead of leaving the stale one to throw again after every later test.closeWindow()only reaps windows that existed when it was called, never the next test's window.- The WebContentsView reuse spec compares webContents sets instead of a GC-sensitive count.
- The
document.visibilityStatespecs listen on the window's ownwebContents.ipcinstead ofipcMain, so a late message from the previous test's page is not mistaken for the new window's. - The BrowserWindow.focus() spec waits for the window to take focus before calling
blur(). - The utilityProcess heap snapshot spec gets 60 s instead of 30.
- The powerMonitor specs clear the logind mock's call log first, so they only count their own process's Inhibit calls.
describe/itaccept an options object between title and body,(title, { timeout, retry, tags }, fn).- Suites that need OS focus, the clipboard, screen capture, global shortcuts, real mouse input, the D-Bus mocks or Squirrel.Mac's shared cache are tagged
{ tags: ['serial'] }(a no-op for mocha).
Checklist
- I have built and tested this change
- I have filled out the PR description
- I have reviewed and verified the changes
-
npm testpasses - tests are changed or added
Release Notes
Notes: none
Backports
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