Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
crypto/tls: retry DialWithTimeout until the listener accepts a connec…
…tion The point of DialWithTimeout seems to be to test what happens when the connection times out during handshake. However, the test wasn't actually verifying that the connection made it into the handshake at all. That would not only fail to test the intended behavior, but also leak the Accept goroutine until arbitrarily later, at which point it may call t.Error after the test t is already done. Instead, we now: - retry the test with a longer timeout if we didn't accept a connection, and - wait for the Accept goroutine to actually complete when the test finishes. Fixes golang#59646. Change-Id: Ie56ce3297e2c183c02e67b8f6b26a71e50964558 Reviewed-on: https://go-review.googlesource.com/c/go/+/485115 Run-TryBot: Bryan Mills <[email protected]> Reviewed-by: Roland Shoemaker <[email protected]> Auto-Submit: Bryan Mills <[email protected]> Commit-Queue: Bryan Mills <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
- Loading branch information