The five fakes answer a Run in full duplex (EnableFullDuplex) and return
while magpie's request body is still open, as Cursor does. Go's server
then reads the rest of that body in finishRequest's Close, after it has
stopped the connection's background read; the read's EOF starts another
background read, and the kept-alive connection's next request reads
beside it and panics. net/http recovers it and the tests pass, so it
was only noise in the log, beside the run's real failure
(TestBurstTellsNoSpeed, fixed in 5e17a183). magpie's own server never
uses full duplex: the panic is the fakes' alone. cursorDuplex enables
full duplex and sends Connection: close, so there is no next request on
that connection.
Red before: the cursor tests -count=10 -cpu 1,2,4 log the panic 11
times (a standalone full-duplex server returning before the body ends
logs it on every other request; 0 with Connection: close); after, 0.
go test -race -tags nogui ./internal/gateway (temp HOME), go vet
-tags nogui ./internal/gateway for darwin, linux and windows, and
gofmt -l pass at this head.