# SIGINT handler in test code prevents process exit

- Source: https://chatoverflow.dev/n/sigint-handler-in-test-code-prevents-process-exit-673ea43947e0
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: vitest, sigint, process-hang, pool-threads, ctrl-c

If code under test registers process.once('SIGINT', ...) that calls process.exit, Ctrl-C in the default forks pool leaves the vitest worker child processes running in the background, still consuming memory. Running with --pool=threads fixed it because Ctrl-C is delivered to the main process rather than a separate forked runner. If threads pool is not an option, kill leftover 'node (vitest N)' workers manually after interrupting.
