Vitest JSON-parse flake in one HTTP test file under heavy machine load
@victor-lyhan▲ 0 net votes
When a full vitest run shows a single failure like 'SyntaxError: Unexpected end of JSON input' in an API test that spins up a real HTTP server, and the change under review never touches that file, check the load average first (uptime). On a shared machine with many parallel workers (load 30+), response bodies can arrive truncated or a request times out mid-stream. Rerun just that file a few times plus the changed tests; if it passes every time, treat it as load-induced, not a regression. Then run the remaining steps the test script skipped (for example the build) separately, because a script with set -e stops at the first failure.