From d2f8d6286156f6fb9ddaf01ea7d3a1aee3b5b8d2 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Fri, 26 Oct 2018 11:41:02 -0400 Subject: [PATCH] crypto/tls: bump test timeouts from 1s to 1m for slow builders The arm5 and mips builders are can't-send-a-packet-to-localhost-in-1s slow apparently. 1m is less useful, but still better than an obscure test timeout panic. Fixes #28405 Change-Id: I2feeae6ea1b095114caccaab4f6709f405faebad Reviewed-on: https://go-review.googlesource.com/c/145037 Run-TryBot: Filippo Valsorda TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- handshake_client_test.go | 6 +++--- handshake_server_test.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/handshake_client_test.go b/handshake_client_test.go index 5a1e608..437aaed 100644 --- a/handshake_client_test.go +++ b/handshake_client_test.go @@ -384,12 +384,12 @@ func (test *clientTest) run(t *testing.T, write bool) { } for i, b := range flows { if i%2 == 1 { - serverConn.SetWriteDeadline(time.Now().Add(1 * time.Second)) + serverConn.SetWriteDeadline(time.Now().Add(1 * time.Minute)) serverConn.Write(b) continue } bb := make([]byte, len(b)) - serverConn.SetReadDeadline(time.Now().Add(1 * time.Second)) + serverConn.SetReadDeadline(time.Now().Add(1 * time.Minute)) _, err := io.ReadFull(serverConn, bb) if err != nil { t.Fatalf("%s #%d: %s", test.name, i, err) @@ -1646,7 +1646,7 @@ func TestCloseClientConnectionOnIdleServer(t *testing.T) { serverConn.Read(b[:]) client.Close() }() - client.SetWriteDeadline(time.Now().Add(time.Second)) + client.SetWriteDeadline(time.Now().Add(time.Minute)) err := client.Handshake() if err != nil { if err, ok := err.(net.Error); ok && err.Timeout() { diff --git a/handshake_server_test.go b/handshake_server_test.go index 2a77584..e14adbd 100644 --- a/handshake_server_test.go +++ b/handshake_server_test.go @@ -615,12 +615,12 @@ func (test *serverTest) run(t *testing.T, write bool) { } for i, b := range flows { if i%2 == 0 { - clientConn.SetWriteDeadline(time.Now().Add(1 * time.Second)) + clientConn.SetWriteDeadline(time.Now().Add(1 * time.Minute)) clientConn.Write(b) continue } bb := make([]byte, len(b)) - clientConn.SetReadDeadline(time.Now().Add(1 * time.Second)) + clientConn.SetReadDeadline(time.Now().Add(1 * time.Minute)) n, err := io.ReadFull(clientConn, bb) if err != nil { t.Fatalf("%s #%d: %s\nRead %d, wanted %d, got %x, wanted %x\n", test.name, i+1, err, n, len(bb), bb[:n], b) @@ -1434,7 +1434,7 @@ func TestCloseServerConnectionOnIdleClient(t *testing.T) { clientConn.Write([]byte{'0'}) server.Close() }() - server.SetReadDeadline(time.Now().Add(time.Second)) + server.SetReadDeadline(time.Now().Add(time.Minute)) err := server.Handshake() if err != nil { if err, ok := err.(net.Error); ok && err.Timeout() {