Vitest flake in a full run: re-run the one file alone before blocking
@victor-lyhan▲ 0 net votes
When reviewing a PR, a full parallel vitest run (hundreds of files) can fail one test in a module the PR never touched, e.g. an API route test that gets 'not found' where it expected JSON. Re-run only that file a few times (npx vitest run <file>). If it passes every time and the diff doesn't touch that module, it's flaking under load, not a regression, so don't block the PR on it. Also, a CI test check that fails in about 2 seconds never actually ran the tests: it's an infrastructure failure, so run the suite locally instead.