Duplicate VITEST_POOL_ID
See original GitHub issueDescribe the bug
We see duplicate VITEST_POOL_ID
in our test suite.
The following output is created by logging in beforeAll
and afterAll
like this:
console.log("VITEST_POOL_ID", process.env.VITEST_POOL_ID, process.env.VITEST_WORKER_ID, performance.now())
The output:
VITEST_POOL_ID BEFORE 5 5 1879.1254999637604
VITEST_POOL_ID BEFORE 1 1 1865.7593338489532
VITEST_POOL_ID BEFORE 7 7 1861.8154590129852
VITEST_POOL_ID BEFORE 8 8 1861.237958908081
VITEST_POOL_ID AFTER 7 7 2069.352292060852
VITEST_POOL_ID AFTER 8 8 2106.785749912262
VITEST_POOL_ID BEFORE 1 9 2140.8526248931885
VITEST_POOL_ID BEFORE 1 10 2357.5155839920044
VITEST_POOL_ID BEFORE 1 11 2473.89066696167
VITEST_POOL_ID AFTER 1 1 2993.181624889374
VITEST_POOL_ID BEFORE 3 16 3702.6203339099884
VITEST_POOL_ID AFTER 3 16 3935.632458925247
VITEST_POOL_ID BEFORE 1 17 3931.5376670360565
VITEST_POOL_ID AFTER 1 17 3970.2642500400543
VITEST_POOL_ID BEFORE 1 18 4274.482708930969
VITEST_POOL_ID AFTER 1 18 4356.533874988556
VITEST_POOL_ID AFTER 1 10 10438.08066701889
VITEST_POOL_ID AFTER 1 9 13164.534374952316
VITEST_POOL_ID AFTER 1 11 13179.464833974838
You can clearly see in line 7 to 9 that VITEST_POOL_ID
of 1
is used in parallel.
Our vite.config.ts
:
export default defineConfig({
test: {
setupFiles: ["packages/lib.shared.test/test_setup.ts"],
threads: true,
testTimeout: 8000,
hookTimeout: 10000,
minThreads: 8,
maxThreads: 8,
coverage: false,
},
esbuild: {
target: "node16",
},
})
We ever only see VITEST_POOL_ID
of 1
being used in parallel. I checked that VITEST_POOL_ID
matches import {workerId} from "titnypool"
.
Reproduction
Currently I am trying to reproduce the error in tinypool
, but did not manage to do so.
System Info
System:
OS: macOS 12.4
CPU: (10) arm64 Apple M1 Max
Memory: 8.70 GB / 64.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node
Yarn: 3.1.0 - ~/.nvm/versions/node/v16.15.1/bin/yarn
npm: 8.11.0 - ~/.nvm/versions/node/v16.15.1/bin/npm
Browsers:
Chrome: 103.0.5060.53
Firefox: 100.0.2
Safari: 15.5
npmPackages:
vitest: 0.16.0 => 0.16.0
Used Package Manager
yarn
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Issue Analytics
- State:
- Created a year ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Duplicate Detection - Hedge
Hedge will automatically detect duplicates when copying data into an existing folder structure. A file will be not be copied when all of...
Read more >Confusing "duplicate identifier" Typescript error message
When I ran npm start , I got a bunch of duplicate identifier errors. SOLUTION: ... error TS2300: Duplicate identifier 'Promise'.
Read more >ICETOOL in JCL to Remove Duplicates - YouTube
ICETOOL Utility in JCL to Remove Duplicates with Examples - FIRST, FIRSTDUP, ALLDUPS, NODUPS, LAST, EQUAL, HIGHER, LOWER | Mainframe Guru1.
Read more >How to resolve Duplicate Device IDs - YouTube
It's super important to have unique Device IDs on your BACnet system, but duplicates are a very common problem. You might not even...
Read more >"Duplicate inclusion" messages whenever I run bitbake
The duplicate inclusion warnings are caused by sourcing fsl-setup-env on an existing build. A side effect of this is that layer.conf and bblayers.conf...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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!
No, it is not expected behaviour.
VITEST_WORKER_ID
is generated by Vitest whenever we fire up a worker.VITEST_POOL_ID
should be unique while running tests (it’s a queue, when one worker is removed, we can reuse it’s ID). See: https://github.com/vitest-dev/vitest/issues/1469