Skip to content

Commit

Permalink
Merge pull request #3393 from nspcc-dev/testrpc
Browse files Browse the repository at this point in the history
rpc: fix TestRPC timeout
  • Loading branch information
AnnaShaleva authored Apr 2, 2024
2 parents 5c995e7 + 65dbd53 commit 3090165
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/services/rpcsrv/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 3090165

Please sign in to comment.