Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
contrib/net/http: fix flaky TestRoundTripperNetworkError (#1292)
The test was intended to cause an HTTP request to time out on the client side, but this timeout was induced with a short sleep in the HTTP handler. This caused the test to sometimes fail in CI. Removing the sleep made the test fail consistently. To force the client to time out, make the handler wait on a channel that doesn't close until the end of the test. This fix can be verified locally by setting the client timeout to a very long value like 1 minute. The test will still pass. Fixes #1291.
- Loading branch information