From e89b82ea9b3d6733a569d1cec7956a59fcf129bd Mon Sep 17 00:00:00 2001 From: rayoo Date: Wed, 20 May 2026 11:13:54 +0800 Subject: [PATCH] rpc: tolerate Windows close-error in websocket read-limit test On Windows the read-limit violation surfaces as "wsarecv: An existing connection was forcibly closed by the remote host" instead of "connection reset by peer", causing TestServerWebsocketReadLimit to flake. Accept "forcibly closed" as another expected error string. --- rpc/server_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpc/server_test.go b/rpc/server_test.go index 8334d4e80d..d683cdde36 100644 --- a/rpc/server_test.go +++ b/rpc/server_test.go @@ -274,7 +274,8 @@ func TestServerWebsocketReadLimit(t *testing.T) { } else if !errors.Is(err, websocket.ErrReadLimit) && !strings.Contains(strings.ToLower(err.Error()), "1009") && !strings.Contains(strings.ToLower(err.Error()), "message too big") && - !strings.Contains(strings.ToLower(err.Error()), "connection reset by peer") { + !strings.Contains(strings.ToLower(err.Error()), "connection reset by peer") && + !strings.Contains(strings.ToLower(err.Error()), "forcibly closed") { // Not the error we expect from exceeding the message size limit. t.Fatalf("unexpected error for read limit violation: %v", err) }