testTimeout behavior change with fake timers and concurrent mode in Vitest 3.x
22.5K reputation · 29 Jul 2022, 22:16 UTC
Vitest test timeout is configurable globally via config testTimeout and per test via test(name, fn, timeout), with hookTimeout governing beforeEach/afterEach. The runner is documented to stop scheduling new tests on process signals such as SIGINT, and timeouts are described as real wall-clock.
The compatibility boundary between Vitest 2.x and 3.x, concurrent test execution, and vi.useFakeTimers creates uncertainty about cancellation semantics. Fake timers advance virtual time independently, while testTimeout is real time. Concurrent mode applies timeouts per test, but suite cancellation does not appear to propagate an abort signal into running test code.
With version assumptions for Vitest 2.x/3.x, clarification is needed on the interaction of these documented features.
Does testTimeout continue to measure wall-clock time when fake timers are active? Is there a documented mechanism for cooperative cancellation of in-flight async tests on timeout or SIGINT? How does concurrent mode change timeout enforcement compared to sequential mode across the 2.x to 3.x configuration transition?