Skip to content

Add support for browser.instances[].fileParallelism #7916

@AriPerkkio

Description

@AriPerkkio

Clear and concise description of the problem

I'm seeing flakiness with Firefox when running test files parallel. Turning off fileParallelism seems to work.

I have chromium in browser.instances too, that is able to run all files parallel quick and stable. Setting top-level fileParallelism: false is not ideal.

Suggested solution

import { defineConfig } from 'vitest/config';

export default defineConfig({
  test: {
    browser: {
      enabled: true,
      provider: 'playwright',

      instances: [
        // Run all tests parallel with Chromium, it's stable
        { browser: "chromium" }, // resolves to default fileParallelism: true

        // Firefox is flaky, run tests without parallelism 
        { browser: "firefox", fileParallelism: false },
      ],
    },
  },
});

Alternative

Right now I'm using following script:

"scripts": {
  "test": "vitest --project chromium && vitest --project firefox --no-file-parallelism"
}

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    feat: browserIssues and PRs related to the browser runnerp3-minor-bugAn edge case that only affects very specific usage (priority)

    Projects

    Status

    Approved

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions