-
Notifications
You must be signed in to change notification settings - Fork 350
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
fix flaky test #2513
fix flaky test #2513
Conversation
…oundTrip and transport to do the request Signed-off-by: Sandor Szücs <[email protected]>
Works on my machine :) ]% go test ./filters/tee -run TestTeeEndToEndBody2TeeRoutesAndClosing -count 100 |
#2443 fixes the other flaky test (admission control test) |
👍 |
rt := net.NewTransport(net.Options{}) | ||
defer rt.Close() | ||
rsp, err := rt.RoundTrip(req) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should use proxy.Client() which is https://pkg.go.dev/net/http/httptest#Server.Client
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I misunderstood the problem this is fixing.
http client can sometimes create more than one request
Maybe its worth expanding when this can happen and how it is related to the flaky test this fixes.
👍 |
fix: #2435 stdlib http client can sometimes create more than one request, so use RoundTrip and transport instead