Error: [birpc] timeout on calling "onTaskUpdate" is sometimes thrown
Describe the bug
When running vitest dev --browser.name=chromium --no-browser.headless to debug a test and you debug for more than 60s, the browser is closed, you lose the debug session and the Vite process exits with
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Rejection ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Error: [birpc] timeout on calling "onTaskUpdate"
❯ Timeout._onTimeout node_modules/vitest/dist/vendor-index.b271ebe4.js:39:22
❯ listOnTimeout node:internal/timers:573:17
❯ process.processTimers node:internal/timers:514:7
Reproduction
it('should not crash', () => {
debugger;
});
System Info
System:
OS: macOS 14.0
CPU: (10) arm64 Apple M1 Max
Memory: 1011.86 MB / 64.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.9.0 - ~/.nvm/versions/node/v20.9.0/bin/node
npm: 10.1.0 - ~/.nvm/versions/node/v20.9.0/bin/npm
bun: 1.0.7 - ~/.bun/bin/bun
Browsers:
Brave Browser: 107.1.45.123
Chrome: 119.0.6045.123
Chrome Canary: 121.0.6125.0
Edge: 119.0.2151.58
Safari: 17.0
npmPackages:
@vitejs/plugin-react: 4.1.1 => 4.1.1
@vitest/browser: ^0.34.6 => 0.34.6
@vitest/ui: ^0.34.6 => 0.34.6
vite: 4.5.0 => 4.5.0
vitest: ^0.34.6 => 0.34.6
Used Package Manager
npm
Validations
- [X] Follow our Code of Conduct
- [X] Read the Contributing Guidelines.
- [X] Read the docs.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- [X] The provided reproduction is a minimal reproducible example of the bug.
This also happens seemingly randomly when running vitest watch and then you need to restart the process
I'm also seeing this regularly in a workspace based setup where multiple browser and non-browser tests are run together. Here, the timeout occurs much more frequently than if we run only the browser tests specifically.
The hacky workaround here for debugging is to go and edit node_modules/vitest/dist/vendor/index.cAUulNDf.js and change the default birpc timeout to something larger, e.g.
const DEFAULT_TIMEOUT = 6e7;
Same here in a file with 61 tests. Passed locally but failed on CI. After splitting the tests into 2 separate files it passed in CI too.
I have also run into this in CI but not locally. The option workaround I found was to flushPromises await new Promise(res => setImmediate(res)) in afterEach for the tests these errors popped up in. I haven't been able to determine the root cause.
I could not reproduce this on the latest beta.
I have not seen this error in quite some time, even with vitest 1.6
Last weekly we decided to close the issue if it's not reproducible. Feel free to reopen it if the issue still persists.