aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2022-01-27 19:54:47 -0800
committerIan Lance Taylor <iant@golang.org>2022-02-09 19:56:52 +0000
commitdb638375bc3a8f7001553e4583d33aa9585a3c8d (patch)
tree96f2654232fb7aabe46f3f14edd9723145b75ddf
parentdad33157f4bf4f89d0a15a28ea3ccee0bf2f48a5 (diff)
downloadgo-x-crypto-db638375bc3a8f7001553e4583d33aa9585a3c8d.tar.xz
ssh: accept WSAECONNABORTED in TestClientAuthMaxAuthTriesPublicKey
Fixes golang/go#50805 Change-Id: Icdd2835b1626240faf61936288f279570c873158 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/381614 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Roland Shoemaker <roland@golang.org>
-rw-r--r--ssh/client_auth_test.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/ssh/client_auth_test.go b/ssh/client_auth_test.go
index 63a8e22..f73079b 100644
--- a/ssh/client_auth_test.go
+++ b/ssh/client_auth_test.go
@@ -13,6 +13,7 @@ import (
"log"
"net"
"os"
+ "runtime"
"strings"
"testing"
)
@@ -639,7 +640,15 @@ func TestClientAuthMaxAuthTriesPublicKey(t *testing.T) {
if err := tryAuth(t, invalidConfig); err == nil {
t.Fatalf("client: got no error, want %s", expectedErr)
} else if err.Error() != expectedErr.Error() {
- t.Fatalf("client: got %s, want %s", err, expectedErr)
+ // On Windows we can see a WSAECONNABORTED error
+ // if the client writes another authentication request
+ // before the client goroutine reads the disconnection
+ // message. See issue 50805.
+ if runtime.GOOS == "windows" && strings.Contains(err.Error(), "wsarecv: An established connection was aborted") {
+ // OK.
+ } else {
+ t.Fatalf("client: got %s, want %s", err, expectedErr)
+ }
}
}