question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Duplicate VITEST_POOL_ID

See original GitHub issue

Describe 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

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Aslemammadcommented, Jul 14, 2022

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!

1reaction
sheremet-vacommented, Jul 14, 2022

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found