Timeout during test context setup makes all retries fail
Author: SomaH123Created Oct 1, 2026Updated Oct 1, 2026
Labelspending triage
Describe the bug
If you use test context, and the running test times out before the fixture setup gets resolved (due to heavy workload and/or a short testTimeout), vitest will fail on all the other retries of the same test, too.
In withFixtures:
- The fixture is added to
cachedFixturesbeforeawait resolveTestFixtureValue(...). - The
cachedFixtures.delete(fixture)cleanup is only registered after that await resolves. - A timeout mid-setup therefore leaves the fixture marked as initialised, so the retry skips it and gets undefined.
Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-zvwbbrhu?file=test%2Freproduction.test.ts
System Info
System:
OS: Linux 6.18 Manjaro Linux
CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz
Memory: 9.26 GB / 31.07 GB
Container: Yes
Shell: 5.3.9 - /bin/bash
Binaries:
Node: 24.19.0 - /home/somah/.nvm/versions/node/v24.19.0/bin/node
npm: 12.0.2 - /home/somah/.nvm/versions/node/v24.19.0/bin/npm
pnpm: 10.33.0 - /usr/bin/pnpm
Browsers:
Brave Browser: 147.1.89.145
Chromium: 148.0.7778.96
Firefox: 150.0.1
Firefox Developer Edition: 150.0.1
npmPackages:
@vitejs/plugin-vue: ^6.0.9 => 6.0.9
@vitest/browser-playwright: ^5.0.1 => 5.0.1
@vitest/coverage-istanbul: ^5.0.1 => 5.0.1
playwright: ^1.63.0 => 1.63.0
vite: ^8.3.1 => 8.3.1
vitest: ^5.0.1 => 5.0.1
vitest-browser-vue: ^3.1.0 => 3.1.0Used Package Manager
npm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Source: vitest-dev/vitest