On a loaded system, sometimes connections don't work out.
Ignore those in TestTransportPersistConnLeak to avoid flakes.
For #33585.
Change-Id: Ic07057532dc0ea5115d6ec49c3c29099a9382295
Reviewed-on: https://go-review.googlesource.com/c/go/+/261538
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Russ Cox <rsc@golang.org>
res, err := c.Get(ts.URL)
didReqCh <- true
if err != nil {
- t.Errorf("client fetch error: %v", err)
+ t.Logf("client fetch error: %v", err)
failed <- true
return
}
case <-gotReqCh:
// ok
case <-failed:
- close(unblockCh)
- return
+ // Not great but not what we are testing:
+ // sometimes an overloaded system will fail to make all the connections.
}
}
nhigh := runtime.NumGoroutine()
// Tell all handlers to unblock and reply.
- for i := 0; i < numReq; i++ {
- unblockCh <- true
- }
+ close(unblockCh)
// Wait for all HTTP clients to be done.
for i := 0; i < numReq; i++ {