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/transport: fixed wait time in TestTransportPersistConnLeak is too short #14887

Closed
millerresearch opened this issue Mar 20, 2016 · 1 comment

Comments

@millerresearch
Copy link
Contributor

The plan9_arm builder sometimes fails in net/http/transport tests with output like:

 --- FAIL: TestTransportPersistConnLeak
     transport_test.go:1032: goroutine growth: 59 -> 162 -> 66 (delta: 7)
     transport_test.go:1033: too many new goroutines

This test has a fixed sleep time of 100ms to allow goroutines to exit after CloseIdleConnections is called. On a Raspberry Pi running many simultaneous tests, this is not always long enough.

A similar function TestTransportPersistConnLeakShortBody has a sleep time of 400ms for the same purpose (originally 50ms but revised upwards in CL 12960046). This seems to be plenty of time for plan9_arm, but on faster hosts will usually be much more than necessary.

Instead of just increasing the sleep time, I propose replacing the fixed sleep in both tests by calls to a new function which will do shorter sleeps in a loop until the number of goroutines reaches the desired threshold or an overall timeout expires.

@gopherbot
Copy link
Contributor

CL https://golang.org/cl/20922 mentions this issue.

@golang golang locked and limited conversation to collaborators Mar 20, 2017
@golang golang unlocked this conversation Aug 12, 2019
@golang golang locked as resolved and limited conversation to collaborators Aug 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants