Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/http: occasional timeouts in TestTransportProxyHTTPSConnectTimeout #36082

Closed
bcmills opened this issue Dec 11, 2019 · 4 comments · Fixed by sthagen/golang-go#76
Closed

net/http: occasional timeouts in TestTransportProxyHTTPSConnectTimeout #36082

bcmills opened this issue Dec 11, 2019 · 4 comments · Fixed by sthagen/golang-go#76
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Dec 11, 2019

net/http.TestTransportProxyHTTPSConnectTimeout is occasionally failing on multiple builders.

The test was newly added in CL 210286 (#28012). These failures are after CL 210738, so they aren't symptoms of the bug reported in #36070.

It's not obvious to me whether the problem is in the test itself, or in the code under test.

--- FAIL: TestTransportProxyHTTPSConnectTimeout (5.06s)
    transport_test.go:1496: timeout waiting for Transport to close its connection to the proxy
    transport_test.go:1457: Accept: accept tcp 127.0.0.1:34137: use of closed network connection
FAIL
FAIL	net/http	20.370s

2019-12-11T01:10:28-a1a67e6/linux-ppc64-buildlet
2019-12-11T00:01:17-9c8c27a/linux-arm64-packet
2019-12-10T21:11:20-207a0b7/linux-arm64-packet
2019-12-10T21:11:20-207a0b7/solaris-amd64-oraclerel

CC @bradfitz @ianlancetaylor

@bcmills bcmills added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker labels Dec 11, 2019
@bcmills bcmills added this to the Go1.14 milestone Dec 11, 2019
@bcmills bcmills changed the title net/http: occasional timeout failures in TestTransportProxyHTTPSConnectTimeout net/http: occasional "use of closed network connection" in TestTransportProxyHTTPSConnectTimeout Dec 11, 2019
@bcmills bcmills changed the title net/http: occasional "use of closed network connection" in TestTransportProxyHTTPSConnectTimeout net/http: occasional timeouts in TestTransportProxyHTTPSConnectTimeout Dec 11, 2019
@bcmills
Copy link
Contributor Author

bcmills commented Dec 11, 2019

I wonder if these builders are just too heavily loaded: perhaps the 5-second timeout is too short.

(The second log line is a secondary symptom of the test timeout: the listener is closed in a deferred call when the test function returns.)

@bcmills
Copy link
Contributor Author

bcmills commented Dec 11, 2019

I'm unable to reproduce this locally using go test -run=TestTransportProxyHTTPSConnectTimeout -count=1000 on a linux/amd64 system with 6 cores.

@bcmills
Copy link
Contributor Author

bcmills commented Dec 11, 2019

Ah, here's a theory: perhaps the 50ms timeout set on the Client in the test is too short. If I crank it down to 1ms, I can reproduce the failure locally.

Perhaps we just need to replace the timeout with synchronization and cancellation.

@bcmills bcmills self-assigned this Dec 11, 2019
@bcmills bcmills added the Testing An issue that has been verified to require only test changes, not just a test failure. label Dec 11, 2019
@gopherbot
Copy link

Change https://golang.org/cl/210857 mentions this issue: net/http: use cancellation instead of a timeout in TestTransportProxyHTTPSConnectTimeout

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker Testing An issue that has been verified to require only test changes, not just a test failure.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants