lib/runtime/web.test.ts > startWeb stop > "closes keep-alive connections that keep sending requests" fails intermittently with AssertionError: expected 0 to be greater than 0 on expect(closedResponses.length).toBeGreaterThan(0).
How I know: running pnpm exec vp test lib/runtime/web.test.ts -t "keep-alive connections that keep sending" ten times in a row gave 3 failures and 7 passes. The test builds a plain Hono app and does not touch mountBuiltAssets, so the flake does not come from the /static/* cache-header change. It also failed once in a full-file run.
Where to start: the test only counts responses that come back with Connection: close once stopping is set. If the request in flight when stop() begins is the last one before the server closes the socket, or if the loop's next request hits the closed socket first and errors, no Connection: close response is recorded. Either guarantee that a request is in flight when stop() runs (for example, start stop() from inside the /busy handler), or assert on the connection closing rather than on a counted response.
Found by the loop while working on an issue, rkey 3myla7csycu22.
Queued: the loop will work on this version of the issue.
loop:queued cid=bafyreih2j2r4mwm2hqu6s44dybs4pfdiqwphqcatxklfjktlaboy3og3zi