Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browser tests don't run in parallel with browser.enabled = true #6834

Open
6 tasks done
timganter opened this issue Oct 31, 2024 · 1 comment
Open
6 tasks done

Browser tests don't run in parallel with browser.enabled = true #6834

timganter opened this issue Oct 31, 2024 · 1 comment
Labels
feat: browser Issues and PRs related to the browser runner feat: workspace Issues and PRs related to the workspace feature p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@timganter
Copy link

Describe the bug

When running a single test file using playwright in webkit, chromium, and firefox in a workspace, they run sequentially instead of in parallel.

Reproduction

Steps to reproduce

  1. Download this stackblitz: https://stackblitz.com/edit/vitest-dev-vitest-ezbb8s
  2. npm install (locally)
  3. npm test (locally)

You should see that the browser tests run locally. Confirmed by @hi-ogawa over Discord who suggested making an issue.

Video of repro

sequence.mov

System Info

MacBook Pro with `Total Number of Cores: 12 (8 performance and 4 efficiency)`

Used Package Manager

npm

Validations

@timganter timganter changed the title Browser tests don't run in parallel with browser.enabled = true Browser tests don't run in parallel with browser.enabled = true Oct 31, 2024
@hi-ogawa hi-ogawa added feat: browser Issues and PRs related to the browser runner feat: workspace Issues and PRs related to the workspace feature labels Nov 1, 2024
@hi-ogawa
Copy link
Contributor

hi-ogawa commented Nov 1, 2024

I just found there's TODO for this.

// TODO: paralellize tests instead of running them sequentially (based on CPU?)
for (const [project, files] of groupedFiles.entries()) {
if (isCancelled) {
break
}
await executeTests(method, project, files)
}

Probably you can patch this to Promise.all and see how it goes. I think the concern is that running multiple browsers can be heavy especially on CI with less resource.

    await Promise.all(groupedFiles.entries().map(async ([project, files]) => {
      await executeTests(method, project, files)
    }))

@sheremet-va sheremet-va added p3-minor-bug An edge case that only affects very specific usage (priority) and removed pending triage labels Nov 5, 2024
@sheremet-va sheremet-va moved this to Approved in Team Board Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: browser Issues and PRs related to the browser runner feat: workspace Issues and PRs related to the workspace feature p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
Status: Approved
Development

No branches or pull requests

3 participants