]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: remove another arbitrary timeout in TestTLSHandshakeTimeout
authorBryan C. Mills <bcmills@google.com>
Fri, 27 Mar 2020 21:16:26 +0000 (17:16 -0400)
committerGopher Robot <gobot@golang.org>
Wed, 1 Feb 2023 16:24:24 +0000 (16:24 +0000)
Updates #37327

Change-Id: I87774be71ed54e9c45a27062122e6177888e890a
Reviewed-on: https://go-review.googlesource.com/c/go/+/226137
Auto-Submit: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
src/net/http/serve_test.go

index eac527b94f3d6ac0b94cac14cfe6a05bb64e3871..e11de6607718de5f80212691ba4a8585d4fe7ee7 100644 (file)
@@ -1444,13 +1444,9 @@ func testTLSHandshakeTimeout(t *testing.T, mode testMode) {
                t.Errorf("Read = %d, %v; want an error and no bytes", n, err)
        }
 
-       select {
-       case v := <-errc:
-               if !strings.Contains(v, "timeout") && !strings.Contains(v, "TLS handshake") {
-                       t.Errorf("expected a TLS handshake timeout error; got %q", v)
-               }
-       case <-time.After(5 * time.Second):
-               t.Errorf("timeout waiting for logged error")
+       v := <-errc
+       if !strings.Contains(v, "timeout") && !strings.Contains(v, "TLS handshake") {
+               t.Errorf("expected a TLS handshake timeout error; got %q", v)
        }
 }