mirror of
https://github.com/golang/go
synced 2024-11-12 03:50:21 -07:00
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
This commit is contained in:
parent
f884e15aab
commit
a5166a9512
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user