Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
godoc/redirect: close HTTP response bodies in TestRedirect
In https://go.dev/issue/50879, we observe ECONNRESET errors from 'dial' in TestRedirect for various paths. That seems to imply that a unique connection is being dialed for each path — but these connections are all going through http.DefaultTransport, which has a 30-second keepalive, and the test takes well under that amount of time to complete. The only reason we would be dialing a connection per request would be if the connection itself leaks — and, indeed, inspecting the test in more detail it fails to close the response body. I don't know why failing to close the response body would lead to ECONNRESET errors, but at the very least fixing that issue should reduce the number of 'dial' operations and thus the number of platform-specific failure modes. Fixes golang/go#50879. (Maybe.) Change-Id: I5af47ee3683c54106424c66e94b021a0ec7e6d2d Reviewed-on: https://go-review.googlesource.com/c/tools/+/381736 Trust: Bryan Mills <[email protected]> Run-TryBot: Bryan Mills <[email protected]> gopls-CI: kokoro <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
- Loading branch information