From 2f3db220d1ff1610e315d95d276782d4533f052b Mon Sep 17 00:00:00 2001 From: Johan Brandhorst Date: Wed, 17 Mar 2021 14:13:35 +0000 Subject: [PATCH] crypto/tls: remove flaky cancellation test This will be reintroduced again once the source of the flakiness has been determined and fixed. Fixes #45084 Change-Id: I6677b27fcd71e8c9bb8edbe8e3be70e5a271ebd3 Reviewed-on: https://go-review.googlesource.com/c/go/+/302569 Trust: Johan Brandhorst-Satzkorn Trust: Katie Hockman Run-TryBot: Johan Brandhorst-Satzkorn Run-TryBot: Katie Hockman Reviewed-by: Katie Hockman TryBot-Result: Go Bot --- src/crypto/tls/handshake_client_test.go | 36 ------------------------- 1 file changed, 36 deletions(-) diff --git a/src/crypto/tls/handshake_client_test.go b/src/crypto/tls/handshake_client_test.go index 2f30b3008d..693f9686a7 100644 --- a/src/crypto/tls/handshake_client_test.go +++ b/src/crypto/tls/handshake_client_test.go @@ -6,7 +6,6 @@ package tls import ( "bytes" - "context" "crypto/rsa" "crypto/x509" "encoding/base64" @@ -21,7 +20,6 @@ import ( "os/exec" "path/filepath" "reflect" - "runtime" "strconv" "strings" "testing" @@ -2513,37 +2511,3 @@ func testResumptionKeepsOCSPAndSCT(t *testing.T, ver uint16) { serverConfig.Certificates[0].SignedCertificateTimestamps, ccs.SignedCertificateTimestamps) } } - -func TestClientHandshakeContextCancellation(t *testing.T) { - c, s := localPipe(t) - serverConfig := testConfig.Clone() - serverErr := make(chan error, 1) - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - go func() { - defer close(serverErr) - defer s.Close() - conn := Server(s, serverConfig) - _, err := conn.readClientHello(ctx) - cancel() - serverErr <- err - }() - cli := Client(c, testConfig) - err := cli.HandshakeContext(ctx) - if err == nil { - t.Fatal("Client handshake did not error when the context was canceled") - } - if err != context.Canceled { - t.Errorf("Unexpected client handshake error: %v", err) - } - if err := <-serverErr; err != nil { - t.Errorf("Unexpected server error: %v", err) - } - if runtime.GOARCH == "wasm" { - t.Skip("conn.Close does not error as expected when called multiple times on WASM") - } - err = cli.Close() - if err == nil { - t.Error("Client connection was not closed when the context was canceled") - } -}