From e0df023530c570387a64568982734eab9a4eccda Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Wed, 9 Feb 2022 20:14:11 +0300 Subject: [PATCH] network: tune waiting limits in tests Some tests are failing on Windows due to slow runners with errors like the following: ``` 2022-02-09T17:11:20.3127016Z --- FAIL: TestGetData/transaction (1.82s) 2022-02-09T17:11:20.3127385Z server_test.go:500: 2022-02-09T17:11:20.3127878Z Error Trace: server_test.go:500 2022-02-09T17:11:20.3128533Z server_test.go:520 2022-02-09T17:11:20.3128978Z Error: Condition never satisfied 2022-02-09T17:11:20.3129479Z Test: TestGetData/transaction ``` --- pkg/network/server_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/network/server_test.go b/pkg/network/server_test.go index d20d8a59ae..0624b157b2 100644 --- a/pkg/network/server_test.go +++ b/pkg/network/server_test.go @@ -404,7 +404,7 @@ func TestBlock(t *testing.T) { b := block.New(false) b.Index = 12345 s.testHandleMessage(t, nil, CMDBlock, b) - require.Eventually(t, func() bool { return s.chain.BlockHeight() == 12345 }, time.Second, time.Millisecond*500) + require.Eventually(t, func() bool { return s.chain.BlockHeight() == 12345 }, 2*time.Second, time.Millisecond*500) } func TestConsensus(t *testing.T) { @@ -497,8 +497,8 @@ func (s *Server) testHandleGetData(t *testing.T, invType payload.InventoryType, s.testHandleMessage(t, p, CMDGetData, payload.NewInventory(invType, hs)) - require.Eventually(t, func() bool { return recvResponse.Load() }, time.Second, time.Millisecond) - require.Eventually(t, func() bool { return recvNotFound.Load() }, time.Second, time.Millisecond) + require.Eventually(t, func() bool { return recvResponse.Load() }, 2*time.Second, time.Millisecond) + require.Eventually(t, func() bool { return recvNotFound.Load() }, 2*time.Second, time.Millisecond) } func TestGetData(t *testing.T) {