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 <ekt@morphbits.io>
This commit is contained in:
Ekaterina Pavlova 2024-03-08 01:45:08 +03:00
parent 0e47d662b5
commit 588d7c6418

View file

@ -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++ {