-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: "Test appears to have leaked a Transport" on darwin-amd64-longtest #59526
Comments
For reference, the bug for the 2020 failures was #42943 |
This bug easily reproduces on a The full set of failures I get in net/http:
( |
For those requests, Perhaps the solution is to wrap the |
I'm not sure what's going on with |
It can be fixed in the same way: by adding a |
I think I wrote TestMaxBytesHandler. As I recall I just copypasta’d another test. Sorry if it’s buggy! 😓 |
FWIW, |
Change https://go.dev/cl/483895 mentions this issue: |
I think failures reported in Probably the leak check should just be disabled after the first report. |
Change https://go.dev/cl/483896 mentions this issue: |
We don't have a way to terminate the leaked goroutines, and we can't wait forever for them to exit (or else we would risk timing out the test and losing the log line describing what exactly leaked). So we have reason to believe that they will remain leaked while we run the next test, and we don't want the goroutines from the first leak to generate a spurious error when the second test completes. This also removes a racy Parallel call I added in CL 476036, which was flagged by the race detector in the duplicate-suppression check. (I hadn't considered the potential interaction with the leak checker.) For #59526. Updates #56421. Change-Id: Ib1f759f102fb41ece114401680cd728343e58545 Reviewed-on: https://go-review.googlesource.com/c/go/+/483896 TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Michael Pratt <[email protected]> Auto-Submit: Bryan Mills <[email protected]> Run-TryBot: Bryan Mills <[email protected]>
In TestTransportPrefersResponseOverWriteError and TestMaxBytesHandler, the server may respond to an incoming request without ever reading the request body. The client's Do method will return as soon as the server's response headers are read, but the Transport will remain active until it notices that the server has closed the connection, which may be arbitrarily later. When the server has closed the connection, it will call the Close method on the request body (if it has such a method). So we can use that method to find out when the Transport is close enough to done for the test to complete without interfering too much with other tests. For #57612. For #59526. Change-Id: Iddc7a3b7b09429113ad76ccc1c090ebc9e1835a1 Reviewed-on: https://go-review.googlesource.com/c/go/+/483895 Run-TryBot: Bryan Mills <[email protected]> Commit-Queue: Bryan Mills <[email protected]> Auto-Submit: Bryan Mills <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Michael Pratt <[email protected]>
Fixed in CL 483895. |
The new
darwin-amd64-longtest
builders (#35678) are failing continuously with "Test appears to have leaked a Transport" errors, either inTestTransportPrefersResponseOverWriteError/h1
(5/6 failures) orTestMaxBytesHandler/max_size_100_request_size_1000000/h1
(1/6 failures):2023-04-10T18:52:58-65ea4c5/darwin-amd64-longtest
2023-04-10T17:30:27-5e93a2c/darwin-amd64-longtest
2023-04-10T17:13:41-63a08e6/darwin-amd64-longtest
2023-04-10T17:07:24-a3f3868/darwin-amd64-longtest
2023-04-10T17:06:55-60140a8/darwin-amd64-longtest
2023-04-10T15:57:38-9efca84/darwin-amd64-longtest
The only other failures I see like this in fetchlogs are from 2020, so too old to be obviously related.
cc @neild @bcmills
The text was updated successfully, but these errors were encountered: