Skip to content

[🐞] Concurrency issues with larger test suites run in parallel #21

Closed
@ianlet

Description

@ianlet

Describe the bug

By default, vitest will run test files in parallel if there are enough workers to do so. When that's the case, some tests might start failing because the DOM they interact with seems to have been changed by another test or not properly cleaned up before running.

As a workaround, it is possible to force vitest to disable parallelism with the following argument:

vitest run --no-file-parallelism

System Info

System:
    OS: Linux 6.11 Arch Linux
    CPU: (8) x64 Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
    Memory: 5.92 GB / 15.37 GB
    Container: Yes
    Shell: 3.7.1 - /usr/bin/fish
  Binaries:
    Node: 21.6.2 - ~/.asdf/installs/nodejs/21.6.2/bin/node
    Yarn: 1.22.19 - ~/.asdf/shims/yarn
    npm: 10.2.4 - ~/.asdf/plugins/nodejs/shims/npm
    pnpm: 9.2.0 - ~/.asdf/installs/pnpm/9.2.0/bin/pnpm
  Browsers:
    Chromium: 130.0.6723.69
  npmPackages:
    @builder.io/qwik: 1.10.0 => 1.10.0
    @builder.io/qwik-city: 1.10.0 => 1.10.0
    @builder.io/qwik-labs: github:QwikDev/qwik-labs-build#main => 0.0.1
    @noma.to/qwik-testing-library: ^1.2.0 => 1.2.0
    @testing-library/jest-dom: ^6.6.2 => 6.6.2
    @testing-library/user-event: ^14.5.2 => 14.5.2
    jsdom: ^25.0.1 => 25.0.1
    typescript: 5.6.3 => 5.6.3
    undici: ^6.20.1 => 6.20.1
    vite: ^5.4.9 => 5.4.9

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingreleased

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions