From 65dbd537ece347bb619725ae784b840bcf588c03 Mon Sep 17 00:00:00 2001 From: Ekaterina Pavlova Date: Tue, 2 Apr 2024 11:11:14 +0300 Subject: [PATCH] rpc: fix TestRPC timeout Increase timeout to prevent `context deadline exceeded (Client.Timeout exceeded while awaiting headers)`. Close #2975 Signed-off-by: Ekaterina Pavlova --- pkg/services/rpcsrv/server_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/services/rpcsrv/server_test.go b/pkg/services/rpcsrv/server_test.go index cf28d862c..513875121 100644 --- a/pkg/services/rpcsrv/server_test.go +++ b/pkg/services/rpcsrv/server_test.go @@ -3463,7 +3463,7 @@ func doRPCCallOverWS(rpcCall string, url string, t *testing.T) []byte { dialer := websocket.Dialer{ HandshakeTimeout: 5 * time.Second, NetDialContext: func(ctx context.Context, network, addr string) (net.Conn, error) { - dialer := net.Dialer{Timeout: 3 * time.Second, + dialer := net.Dialer{Timeout: 5 * time.Second, KeepAlive: 30 * time.Second, FallbackDelay: -1} return dialer.DialContext(ctx, "tcp4", addr) @@ -3485,13 +3485,13 @@ func doRPCCallOverWS(rpcCall string, url string, t *testing.T) []byte { } func doRPCCallOverHTTP(rpcCall string, url string, t *testing.T) []byte { - cl := http.Client{Timeout: 3 * time.Second, Transport: &http.Transport{ + cl := http.Client{Timeout: 5 * time.Second, Transport: &http.Transport{ MaxIdleConns: 50, MaxConnsPerHost: 50, MaxIdleConnsPerHost: 50, - IdleConnTimeout: 3 * time.Second, + IdleConnTimeout: 5 * time.Second, DialContext: func(ctx context.Context, network, addr string) (net.Conn, error) { - dialer := net.Dialer{Timeout: 3 * time.Second, + dialer := net.Dialer{Timeout: 5 * time.Second, KeepAlive: 30 * time.Second, FallbackDelay: -1} return dialer.DialContext(ctx, "tcp4", addr)