aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/crypto
diff options
context:
space:
mode:
authorAdam Langley <agl@golang.org>2013-05-16 12:29:23 -0400
committerAdam Langley <agl@golang.org>2013-05-16 12:29:23 -0400
commit21cf646bfcc35711ce0c728f3d1e44ffe6b054e8 (patch)
tree4a963a15337d0130bbba04976932e073fc7fafc4 /src/pkg/crypto
parenta65f861bfa7a393e61cbe7aad0d1ecd42a0237be (diff)
downloadgo-21cf646bfcc35711ce0c728f3d1e44ffe6b054e8.tar.xz
crypto/tls: fix flakey test.
A test added in b37d2fdcc4d9 didn't work with some values of GOMAXPROCS because the defer statements were in the wrong order: the Pipe could be closed before the TLS Client was. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/9187047
Diffstat (limited to 'src/pkg/crypto')
-rw-r--r--src/pkg/crypto/tls/handshake_client_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pkg/crypto/tls/handshake_client_test.go b/src/pkg/crypto/tls/handshake_client_test.go
index 7e2bae766c..9446a6e531 100644
--- a/src/pkg/crypto/tls/handshake_client_test.go
+++ b/src/pkg/crypto/tls/handshake_client_test.go
@@ -84,7 +84,7 @@ func TestEmptyRecords(t *testing.T) {
// the first application data from the server. This test ensures that
// the empty record doesn't cause (0, nil) to be returned from
// Conn.Read.
- var config = *testConfig
+ config := *testConfig
config.CipherSuites = []uint16{TLS_RSA_WITH_AES_256_CBC_SHA}
c, s := net.Pipe()
@@ -92,8 +92,8 @@ func TestEmptyRecords(t *testing.T) {
go func() {
buf := make([]byte, 1024)
n, err := cli.Read(buf)
- defer cli.Close()
defer c.Close()
+ defer cli.Close()
if err != nil {
t.Fatalf("error reading from tls.Client: %s", err)