net/http/httptest: Close does not wait for the underlying Server's ConnState callbacks to complete #37510
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
In issue #37505, the observed data race seems to be due to the
http.Server
embedded in anhttptest.Server
firing aConnState
callback after the call to thehttptest.Sever
'sClose
method has already returned.The documentation for
(*httptest.Server).Close
says that it “blocks until all outstanding requests on this server have completed”, so it seems reasonable for users to assume that the correspondingConnState
callbacks on the corresponding connections will have completed by that point as well. Empirically, that does not always happen.CC @bradfitz @rsc @tombergan
The text was updated successfully, but these errors were encountered: