diff options
| author | Bryan C. Mills <bcmills@google.com> | 2023-04-17 10:56:09 -0400 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2023-04-19 21:40:36 +0000 |
| commit | 5c865c78c378548c282b22d96e6d0375079d4417 (patch) | |
| tree | 791bee982af85c4e7726bfde1ba85a3c5f29fb64 /src/encoding/xml/xml_test.go | |
| parent | 42f89db1538ce9c7e48b04615b0bc7ca098946c1 (diff) | |
| download | go-5c865c78c378548c282b22d96e6d0375079d4417.tar.xz | |
crypto/tls: retry DialWithTimeout until the listener accepts a connection
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 #59646.
Change-Id: Ie56ce3297e2c183c02e67b8f6b26a71e50964558
Reviewed-on: https://go-review.googlesource.com/c/go/+/485115
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
Commit-Queue: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/encoding/xml/xml_test.go')
0 files changed, 0 insertions, 0 deletions
