From 588d7c6418aca6637f8b41220cd8560f080045b9 Mon Sep 17 00:00:00 2001 From: Ekaterina Pavlova Date: Fri, 8 Mar 2024 01:45:08 +0300 Subject: [PATCH] rpcsrv: fix concurrent test TestClient_IteratorSessions The default for `MaxConnsPerHost` is "no limit", so it'll use as many connections as it can (potentially hitting MacOS/Windows limits https://github.com/golang/go/issues/20960#issuecomment-447918270 ). Close #3300 Signed-off-by: Ekaterina Pavlova --- pkg/services/rpcsrv/client_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/services/rpcsrv/client_test.go b/pkg/services/rpcsrv/client_test.go index cdc2f80da..3317c7807 100644 --- a/pkg/services/rpcsrv/client_test.go +++ b/pkg/services/rpcsrv/client_test.go @@ -1425,7 +1425,7 @@ func TestClient_NNS(t *testing.T) { func TestClient_IteratorSessions(t *testing.T) { _, rpcSrv, httpSrv := initServerWithInMemoryChain(t) - c, err := rpcclient.New(context.Background(), httpSrv.URL, rpcclient.Options{}) + c, err := rpcclient.New(context.Background(), httpSrv.URL, rpcclient.Options{MaxConnsPerHost: 50}) require.NoError(t, err) require.NoError(t, c.Init()) @@ -1509,8 +1509,8 @@ func TestClient_IteratorSessions(t *testing.T) { wg.Add(storageItemsCount) check := func(t *testing.T) { set, err := c.TraverseIterator(sID, iID, 1) - require.NoError(t, err) - require.Equal(t, 1, len(set)) + assert.NoError(t, err) + assert.Equal(t, 1, len(set)) wg.Done() } for i := 0; i < storageItemsCount; i++ {