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: TestServerShutdownStateNew is flaky #26233

Closed
mvdan opened this issue Jul 5, 2018 · 3 comments
Closed

net/http: TestServerShutdownStateNew is flaky #26233

mvdan opened this issue Jul 5, 2018 · 3 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@mvdan
Copy link
Member

mvdan commented Jul 5, 2018

Two recent failures on linux-amd64-longtest:

https://build.golang.org/log/ef73c0ec3463104a804cba25d4b550a403db26b9
https://build.golang.org/log/6e2a1f6b524c1c8d2f794bce1bae272c87a62ef7

--- FAIL: TestServerShutdownStateNew (2.00s)
    serve_test.go:5603: shutdown too soon after 49.41µs
    serve_test.go:5617: timeout waiting for Read to unblock
FAIL
FAIL	net/http	37.294s

The test accepts shutdowns between 0.5x and 1.5x the expected amount, which is 5s. The result of not even a millisecond seems to point that the test completely breaks, as opposed to this being a timing issue. Looking into it.

/cc @bradfitz

@mvdan mvdan added Testing An issue that has been verified to require only test changes, not just a test failure. NeedsFix The path to resolution is known, but the work has not been done. labels Jul 5, 2018
@mvdan mvdan added this to the Go1.11 milestone Jul 5, 2018
@mvdan
Copy link
Member Author

mvdan commented Jul 5, 2018

Very easy to reproduce with go test -c && stress -p 64 ./http.test -test.run TestServerShutdownStateNew. I get about 10% failures, with the "too soon" times being about 100-200µs.

@mvdan
Copy link
Member Author

mvdan commented Jul 5, 2018

It seems like the issue is that, sometimes, Shutdown gets run before the server accepts the new connection. Then, the server returns ErrServerClosed imimediately, hence the shutdown returns almost immediately. I'll try to deflake this with ConnState, which should let us have the HTTP server notify the test when the connection has been accepted.

@gopherbot
Copy link

Change https://golang.org/cl/122355 mentions this issue: net/http: deflake TestServerShutdownStateNew

@golang golang locked and limited conversation to collaborators Jul 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. Testing An issue that has been verified to require only test changes, not just a test failure.
Projects
None yet
Development

No branches or pull requests

2 participants