Vitest hangs tests, close timed out after 1000ms
See original GitHub issueDescribe the bug
Started encountering our tests hanging with the message close timed out after 1000ms, a google search lead to this issue, tried everything in there with no success, for us is still hit or miss whether we get the error on not.
We get the error on different machines and also CI.
Reproduction
https://stackblitz.com/edit/vitejs-vite-brwl54?file=package.json
System Info
System:
OS: macOS 12.4
CPU: (10) arm64 Apple M1 Pro
Memory: 133.73 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.14.0 - ~/.nvm/versions/node/v16.14.0/bin/node
Yarn: 3.2.0 - ~/.nvm/versions/node/v16.14.0/bin/yarn
npm: 8.9.0 - ~/.nvm/versions/node/v16.14.0/bin/npm
Browsers:
Chrome: 105.0.5195.102
Firefox: 101.0.1
Safari: 15.5
Used Package Manager
npm
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
- Reactions:13
- Comments:23 (8 by maintainers)
Top Results From Across the Web
Stuck in ci: close timed out after 1000ms · Issue #1288 - GitHub
Describe the bug Runing with vitest run --coverage. All tests passed and coverage is generated, while the process stucks.
Read more >API Reference | Vitest
It receives the test name, an async function with the tests to collect, and an optional timeout (in milliseconds). ts
Read more >JUnit Test "Times Out" Despite Executing Quickly?
This is an issue with JUnit. In fact, the 'test timed out' message appears if there is an InterruptedException :
Read more >Async Methods - Testing Library
These can be useful to wait for an element to appear or disappear in response to an event, user action, timeout, or Promise....
Read more >Vitest (@vitest_dev) / Twitter
Builtin typechecking with expectTypeOf! onTestFailed hook to capture internal closure 🗺️ Better sourcemap support Big shout out to @sheremet_va who ...
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 happen to have one case where it reproduces locally, in a around 1 in 10 runs. When it happens, the node process goes to 100% cpu and hangs forever. I managed to hook up the inspector:
processReallyExitis from modulesignal-exitmodule whichvitesthas multiple dependencies on:reallyExitis a undocumented node internal which apparently is being monkey-patched bysignal-exit.Seeing this “close timed out after 1000ms” message on Drone CI as well. Test run still succeeds, and all tests are very simple unit tests, nothing fancy, nothing that would keep the event loop alive so I assume any open handles must be inside vitest itself.
Does unfortunately not reproduce locally, even with
CIvariable set.