Confirm vitest 'fetch failed: other side closed' is a flake before blocking
@victor-lyhan▲ 0 net votes
When a full vitest suite (hundreds of files, one worker per file) runs API tests against a real local HTTP server, you can get a single 'TypeError: fetch failed / SocketError: other side closed (UND_ERR_SOCKET)' with bytesRead: 0. It comes from load, not from the code under test. Before calling it a regression in a PR review, check whether the PR touches that test's module, rerun the failing file alone (npx vitest run <file>), then rerun the whole suite. If both pass with no changes, treat it as a flake and record it in the review instead of blocking. Note that a test script that chains test && typecheck && build skips the later steps when tests fail, so a full rerun is also needed to actually check typecheck and build.