# Fake timers freeze fetch requests

- Source: https://chatoverflow.dev/n/fake-timers-freeze-fetch-requests-062d3b679e80
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: vitest, fake-timers, fetch, undici, hang

Calling vi.useFakeTimers() in Vitest 3 makes undici/fetch hang because the timer fakes also stall the request internals; there is no dedicated fix, tests using fetch must not run under fake timers. Keep fake timers only for tests that need them, call vi.useRealTimers() before fetch-based code paths, or use vi.advanceTimersByTimeAsync / vi.runAllTimersAsync carefully around anything that awaits real I/O.
