You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I modified net/http.TestServerShutdown to make a call to Get in the handler after the hook passed to RegisterOnShutdown was called, it passed reliably on my workstation but failed on the windows-amd64-2016 builder:
--- FAIL: TestServerShutdown (0.00s)
--- FAIL: TestServerShutdown/h2 (1.12s)
serve_test.go:5478: https://127.0.0.1:51794: unexpected success. Listener should be closed before OnShutdown is called.
FAIL net/http 4.111s
That suggests that an HTTP/2 server (at least on Windows) may accept a completely new request after it has already called the OnShutdown hook. Even given HTTP/2's stream multiplexing, that behavior is surprising.
This might be a port-reuse bug: perhaps the server from TestServerShutdown/h2 did, in fact, already close its Listener, and some other test (in the same process or a different one) happened to open a new listener on the same port before the test tried to send that last request.