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
Duplicate VITEST_POOL_ID #1576
Comments
Since there is no reproduction, What I recommend is trying to debug your app with ndb and see if you can find a solution! |
Hey ! I am currently running (integration) test suits against multiple sqlite databases at the same time. Thus the tests are concurrent depending of the core of the machine. I duplicate the original one and assign them different ids. I used first I concluded I will provide a reproduction :) Give me some time. My strategy for a reproduction:
|
Here the reproduction based on a Nuxt 3 template: https://stackblitz.com/edit/nuxt-starter-agwwgz?file=test%2FsetupIntegration.ts,vitest.config.ts Workflow:
What we observe?
Remarks:
Constat:
|
|
Ok also the point in the documentation is unclear about that in https://vitest.dev/config/#setupfiles:
Also "We see duplicate To get a unique ID for each thread, |
No, it is not expected behaviour. |
I created a test and I guess I fixed it, it's a challenging issue! But one thing, @Lyokolux tests were helpful but they don't test the behaviour, because there's a misunderstanding there, and it's that VITEST_POOL_ID can be repeated, no problem with that, but it cannot be repeated at the same two running workers or more! I'll release a new tinypool version soon! |
I expect this to be resolved in tinypool@^0.2.3 cc @flunderpero |
feel free to re-open in case you faced the issue again! |
Describe the bug
We see duplicate
VITEST_POOL_ID
in our test suite.The following output is created by logging in
beforeAll
andafterAll
like this:console.log("VITEST_POOL_ID", process.env.VITEST_POOL_ID, process.env.VITEST_WORKER_ID, performance.now())
The output:
You can clearly see in line 7 to 9 that
VITEST_POOL_ID
of1
is used in parallel.Our
vite.config.ts
:We ever only see
VITEST_POOL_ID
of1
being used in parallel. I checked thatVITEST_POOL_ID
matchesimport {workerId} from "titnypool"
.Reproduction
Currently I am trying to reproduce the error in
tinypool
, but did not manage to do so.System Info
Used Package Manager
yarn
Validations
The text was updated successfully, but these errors were encountered: