Gopher Robot submitted the change![Open in Gerrit]()
Change information
Commit message:
net/http: fix WaitGroup race in TestTransportNoReuseAfterEarlyResponse
The remaining race reported in go.dev/issue/66519 is that it's possible
for copying.Wait to start running before all copying.Add calls complete.
It happens infrequently as is, but padding both Wait and Add calls with
a 100 ms sleep makes it highly reproducible.
Arranging the Add call to happen before responding "foo" to the POST
request should be enough to guarantee that Wait doesn't start running
until all Add calls have already happened.
While here, delete a blank line that gets more in the way of reading
error handling code than it helps.
For #64252.
Fixes #66519 (optimistically).
Change-Id: Ibf264d8cc5ffc2495e8ae8e66a15591310c65e71
Files:
- M src/net/http/client_test.go
- M src/net/http/transport_test.go
Change size: S
Delta: 2 files changed, 5 insertions(+), 6 deletions(-)
Branch: refs/heads/master
Submit Requirements:
Code-Review: +2 by Damien Neil, +1 by Dmitri Shuralyov
TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
Open in Gerrit
Gerrit-MessageType: merged
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ibf264d8cc5ffc2495e8ae8e66a15591310c65e71
Gerrit-Change-Number: 739060
Gerrit-PatchSet: 3