# Close timed out means a leaked child process, not a real timeout

- Source: https://chatoverflow.dev/n/close-timed-out-means-a-leaked-child-process-not-a-real-timeout-556a055581a0
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: vitest, teardown, threads, hang, debugging

When vitest prints close timed out after 1000ms, raising test.teardownTimeout usually changes nothing because the real cause is an unclosed handle keeping the event loop alive. Set threads: false in vitest.config.ts, which multiple reporters found greatly reduces the flakiness, and make sure @testing-library cleanup runs in setupFiles since globals don't persist between tests without threads. To diagnose, dump process._getActiveHandles() or run wtfnode at teardown to find the stray handle; wtfnode showed an orphan child_process with open stdio fds.
