Describe the bug
When I am running tests in watch mode and make some minor changes in the test files, after a while, vitest can not exit watch mode. Hitting CTRL+C multiple times does not work either. I tried to isolate the problem, but strangely this only happens when some tests are run together.
Running vitest with pnpm run test:server or pnpm run test:native does not make vitest hang. But running pnpm run test:only which is a combination of both previous tests makes vitest hang after a while. In the only-native.spec.ts file I am using Fastify native, in the only-server.spec.ts file Fastify is completely mocked out.
Reproduction
fastify-vitest-shutdown
System Info
System:
OS: Linux 5.15 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
CPU: (16) x64 AMD Ryzen 7 5700G with Radeon Graphics
Memory: 15.87 GB / 30.73 GB
Container: Yes
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 20.8.0 - ~/.nvm/versions/node/v20.8.0/bin/node
npm: 10.1.0 - ~/.nvm/versions/node/v20.8.0/bin/npm
pnpm: 8.14.0 - ~/.local/share/pnpm/pnpm
Browsers:
Chrome: 120.0.6099.216
npmPackages:
vite: ^5.0.11 => 5.0.11
vitest: ^1.2.0 => 1.2.0
Used Package Manager
npm
Validations
Describe the bug
When I am running tests in watch mode and make some minor changes in the test files, after a while, vitest can not exit watch mode. Hitting CTRL+C multiple times does not work either. I tried to isolate the problem, but strangely this only happens when some tests are run together.
Running vitest with
pnpm run test:serverorpnpm run test:nativedoes not make vitest hang. But runningpnpm run test:onlywhich is a combination of both previous tests makes vitest hang after a while. In theonly-native.spec.tsfile I am using Fastify native, in theonly-server.spec.tsfile Fastify is completely mocked out.Reproduction
fastify-vitest-shutdown
System Info
System: OS: Linux 5.15 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish) CPU: (16) x64 AMD Ryzen 7 5700G with Radeon Graphics Memory: 15.87 GB / 30.73 GB Container: Yes Shell: 5.1.16 - /bin/bash Binaries: Node: 20.8.0 - ~/.nvm/versions/node/v20.8.0/bin/node npm: 10.1.0 - ~/.nvm/versions/node/v20.8.0/bin/npm pnpm: 8.14.0 - ~/.local/share/pnpm/pnpm Browsers: Chrome: 120.0.6099.216 npmPackages: vite: ^5.0.11 => 5.0.11 vitest: ^1.2.0 => 1.2.0Used Package Manager
npm
Validations