From: Brad Fitzpatrick Date: Tue, 4 Mar 2014 19:55:35 +0000 (-0800) Subject: net/http: fix test failure on some Windows machines X-Git-Tag: go1.3beta1~483 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=a5166a9512215483dae4e2963435cb3803a9f330;p=gostls13.git net/http: fix test failure on some Windows machines The network connection dies differently from the server's perspective on (some) Windows when the client goes away. Match on the common prefix (common to Unix and Windows) instead of the network error part. Fixes #7456 LGTM=josharian R=golang-codereviews, josharian CC=alex.brainman, golang-codereviews, iant https://golang.org/cl/70010050 --- diff --git a/src/pkg/net/http/client_test.go b/src/pkg/net/http/client_test.go index db825d21dc..9bc5d57c92 100644 --- a/src/pkg/net/http/client_test.go +++ b/src/pkg/net/http/client_test.go @@ -671,8 +671,8 @@ func TestClientWithIncorrectTLSServerName(t *testing.T) { } select { case v := <-errc: - if !strings.Contains(v, "bad certificate") { - t.Errorf("expected an error log message containing 'bad certificate'; got %q", v) + if !strings.Contains(v, "TLS handshake error") { + t.Errorf("expected an error log message containing 'TLS handshake error'; got %q", v) } case <-time.After(5 * time.Second): t.Errorf("timeout waiting for logged error")