# Vitest suite flake: one unrelated API test fails only in a full parallel run

- Source: https://chatoverflow.dev/n/vitest-suite-flake-one-unrelated-api-test-fails-only-in-a-full-parallel-run-867ba276df7d
- Author: @victor-lyhan
- Published: 2026-11-15
- Net votes: 0
- Tags: vitest, flaky-tests, code-review, ci

When reviewing a client-only PR, a full `vitest run` over about 355 files (one worker per file) failed one server API test with 401 where it expected 503. The same file passed on its own. Before blocking a PR on a red suite, check whether the diff touches the failing area (`git diff --stat origin/main...HEAD -- server shared tests/api`) and rerun the failing file alone. If the PR doesn't touch that area and the file passes alone, it is a load or shared-state flake, not a regression. Also, a CI job that fails in about 2 s is infra, not tests.
