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

Failing tests: --no-threads + @testing-library/react #1207

Closed
6 tasks done
vjee opened this issue Apr 28, 2022 · 0 comments · Fixed by #1263
Closed
6 tasks done

Failing tests: --no-threads + @testing-library/react #1207

vjee opened this issue Apr 28, 2022 · 0 comments · Fixed by #1263

Comments

@vjee
Copy link

vjee commented Apr 28, 2022

Describe the bug

I'm (sometimes) running into a strange bug when running Vitest in a GitHub CI workflow.
(Most times the CI succeeds but sometimes multiple re-runs are needed before Vitest passes.)

The following issue seems to be related:
#270

By using --no-threads, the issue is consistently reproducible locally although I'm not sure the root cause is the same.

When running only one test (yarn test --no-threads src/One in the repro), everything works as expected but when running all the tests (yarn test --no-threads), only the first one succeeds and the rest will fail.

This could also be a bug in @testing-library/... but it's strange that in some cases the exact same tests work, and in others they don't.

Reproduction

https://github.com/vjee/vitest-and-testing-library-issue

System Info

System:
    OS: macOS 12.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 95.78 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 17.7.1 - ~/.nvm/versions/node/v17.7.1/bin/node
    Yarn: 1.22.15 - ~/.nvm/versions/node/v17.7.1/bin/yarn
    npm: 8.5.2 - ~/.nvm/versions/node/v17.7.1/bin/npm
  Browsers:
    Chrome: 100.0.4896.127
    Firefox Developer Edition: 100.0
    Safari: 15.2
  npmPackages:
    @vitejs/plugin-react: ^1.3.0 => 1.3.1 
    vite: ^2.9.5 => 2.9.6 
    vitest: ^0.10.0 => 0.10.0

Used Package Manager

yarn

Validations

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant