Skip to content

Run Firefox test files in parallel - #4182

Draft
nstepien wants to merge 2 commits into
mainfrom
ff-parallel
Draft

nstepien wants to merge 2 commits into
mainfrom
ff-parallel

Conversation

@nstepien

Copy link
Copy Markdown
Collaborator

Removes fileParallelism: false from the Firefox browser instance.

Vitest runs parallel test files as pages of the same browser, but Firefox pages opened in the same browser share focus and mouse states, so test files interfere with each other:

  • Playwright's Firefox raises the page's window before dispatching mouse events, which blurs the focused element of all the other pages: document.hasFocus() returns false in their iframes, editors close, etc.
  • a click in one page dispatches pointermove/pointerup to the pointer capture target of other pages, ending ongoing drags (column resize, drag fill).

With file parallelism enabled, 149/177 Firefox tests failed.

Changes:

  • add PlaywrightBrowserPerSessionProvider, which extends Vitest's Playwright provider: every session after the first one gets its own browser. It creates the session's context in a new browser before calling openPage(), and the base provider reuses that context.
  • remove fileParallelism: false from the Firefox instance
  • set maxWorkers: 8

Notes:

  • the provider relies on the base provider reusing a session's existing context, which isn't a documented behavior.
  • fileParallelism: false also made Vitest run Firefox test files after the other browsers' tests. Firefox now runs at the same time as Chromium and WebKit.
  • locally, node --run test went from ~60s to ~24s.

🤖 Generated with Claude Code

nstepien and others added 2 commits September 14, 2026 02:59
Firefox pages opened in the same browser share focus and mouse states:
a mouse event raises the window of its page, blurring the focused element
of other pages, and ends pointer captures in other pages.

Launch a separate browser for each Firefox test session so test files can
run in parallel, remove `fileParallelism: false`, and set `maxWorkers: 8`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

1 participant