]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/tls: remove flaky cancellation test
authorJohan Brandhorst <johan.brandhorst@gmail.com>
Wed, 17 Mar 2021 14:13:35 +0000 (14:13 +0000)
committerJohan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Wed, 17 Mar 2021 16:19:21 +0000 (16:19 +0000)
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 <johan.brandhorst@gmail.com>
Trust: Katie Hockman <katie@golang.org>
Run-TryBot: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Run-TryBot: Katie Hockman <katie@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>

src/crypto/tls/handshake_client_test.go

index 2f30b3008d87937b2faabd1152c51d0325243beb..693f9686a790ecd6199f97ad7beebf5d8a98d5bc 100644 (file)
@@ -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")
-       }
-}