Replies: 15 comments 15 replies
|
My observation is that RPC timer in |
|
Have been experiencing this a lot lately. I use Bazel to execute Vitest. Only happens on CI (Github Actions) |
|
I can reproduce this issue locally when sharding out my tests across multiple terminal sessions and I have found that it occurs more frequently when a shard has a test file that has a large number of tests contained within it (like over 30). |
|
I can reproduce the scenario locally under stressed conditions and found that when a test file runs for longer than a certain duration (around 1 minute), the error is triggered. Splitting the tests in that file into multiple files resolved the issue in my case. |
|
I'm seeing it at least 2-3 times per day in GitLab CI. I have 155 test suites with 975 tests. Passes locally w/out any issues on Apple silicon MacBook, but CI is very unreliable. Any ideas on how to fix this? |
|
I have a very similar issue on the open-source project fast-check (here). The issue started to appear when I attempted to bump from 3.0.9 to 3.1.3 and seems to be related to my spec file Docs.spec.ts and its test called file.md. The issue only happens on CI against Ubuntu with Node 22. |
|
Caution We also have this issue. Tests seem to work, but afterwards
Note Setting higher values for test-timeout, hook-timeout or teardown-timeout did not change anything. Tip Workaround that helped us was originally posted here. Put this into the test file which was executed right before the error appears: afterEach(async () => {
// already existing afterEach code goes here
await new Promise(res => setImmediate(res))
}); |
|
Also running into this after upgrading Vitest from 3.0.9 to 3.1.3. Also seeing failures in CI (Jenkins) only; tests pass just fine on my laptop. My solution was to break up a large, long-running test file into smaller test files. That seems to have done the trick (no |
|
Setting See https://vitest.dev/config/#pool. |
|
I am also having this issue. I am using Even if breaking up large tests is a solution, I'd rather not have to limit my test files to arbitrary size limits. My tests should just work even if they are written sub-optimally. Curious what the underlying cause might be. |
|
👋 hey so I thought I'd come back here an update on my situation: My repository has a ton of emotion based theming, and upon removing the theme provider for emotion, my tests ran 1 second faster per test, and I don't have any worker timeout issues anymore. I would like to say the issue was caused by emotion, but it could also be caused by my company's theme provider that uses emotion, so take it with a grain of salt but it worked for us. So, if you can remove unnecessary things for component tests like theme providers from your tests, it will make this issue go away. |
|
I ran into this issue as well. Adding the following to vitest.setup file fixed it. You may be able to target the actual large tests that are causing it if you want to localize flushPromises more, but I didn't feel I needed to. |
|
I'm running into this issue as well. Mostly on Windows CI. Never locally. I'm on Vitest 3.2.4 A lot of the suggestions in this thread is to break larger testfiles up into smaller files. Running that single test file locally these are the timings: Doesn't seem terribly bad, does it? It is doing some filesystem stuff, so I could look into mocking fs to move more of that to in-memory operations to probably speed it up a little bit more. But I'm not sure that'll actually help fix this issue. Now trying the |
|
This is fixed in https://github.com/vitest-dev/vitest/releases/tag/v4.0.0-beta.4 by |




Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
We're facing the following issue when running vitests on CI (Jenkins).
It's now reproducible locally. All tests are passing.
Any thoughts on why this issue might appear?
⎯⎯⎯⎯ Unhandled Rejection ⎯⎯⎯⎯⎯
Error: [vitest-worker]: Timeout calling "onTaskUpdate"
❯ Object.onTimeoutError ../node_modules/vitest/dist/chunks/rpc.B7Mfb-Yf.js:69:17
❯ Timeout._onTimeout ../node_modules/vitest/dist/chunks/index.BpSiYbpB.js:41:41
❯ listOnTimeout node:internal/timers:581:17
❯ processTimers node:internal/timers:519:7
Reproduction
The issue is not reproducible locally only on CI.
System Info
AWS ECS agent vitest configration: test: { environment: 'jsdom', globals: true, retry: isCi ? 2 : 0, setupFiles: './src/setupTests.ts', testTimeout: 150_000, silent: process.env.CI === 'true' }Used Package Manager
npm
Validations
All reactions