From c0f0c3884f73e9245461236fee126cde2ba63db2 Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Mon, 17 Jun 2024 15:35:10 -0500 Subject: [PATCH] adjust eventually usages (#13556) --- common/client/poller_test.go | 7 ++++--- core/services/relay/evm/evmtesting/run_tests.go | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/common/client/poller_test.go b/common/client/poller_test.go index 82a05b5dfc7..bd475ef9293 100644 --- a/common/client/poller_test.go +++ b/common/client/poller_test.go @@ -13,6 +13,7 @@ import ( "go.uber.org/zap" "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" ) func Test_Poller(t *testing.T) { @@ -89,7 +90,7 @@ func Test_Poller(t *testing.T) { } return true } - require.Eventually(t, logsSeen, time.Second, time.Millisecond) + require.Eventually(t, logsSeen, tests.WaitTimeout(t), 100*time.Millisecond) }) t.Run("Test polling timeout", func(t *testing.T) { @@ -114,7 +115,7 @@ func Test_Poller(t *testing.T) { logsSeen := func() bool { return observedLogs.FilterMessage("polling error: context deadline exceeded").Len() >= 1 } - require.Eventually(t, logsSeen, time.Second, time.Millisecond) + require.Eventually(t, logsSeen, tests.WaitTimeout(t), 100*time.Millisecond) }) t.Run("Test unsubscribe during polling", func(t *testing.T) { @@ -145,7 +146,7 @@ func Test_Poller(t *testing.T) { logsSeen := func() bool { return observedLogs.FilterMessage("polling error: context canceled").Len() >= 1 } - require.Eventually(t, logsSeen, time.Second, time.Millisecond) + require.Eventually(t, logsSeen, tests.WaitTimeout(t), 100*time.Millisecond) }) } diff --git a/core/services/relay/evm/evmtesting/run_tests.go b/core/services/relay/evm/evmtesting/run_tests.go index 2c492966729..3058784b30a 100644 --- a/core/services/relay/evm/evmtesting/run_tests.go +++ b/core/services/relay/evm/evmtesting/run_tests.go @@ -39,7 +39,7 @@ func RunChainReaderEvmTests[T TestingT[T]](t T, it *EVMChainReaderInterfaceTeste require.Eventually(t, func() bool { return cr.GetLatestValue(ctx, AnyContractName, triggerWithDynamicTopic, input, output) == nil - }, it.MaxWaitTimeForEvents(), time.Millisecond*10) + }, it.MaxWaitTimeForEvents(), 100*time.Millisecond) assert.Equal(t, &anyString, rOutput.FieldByName("Field").Interface()) topic, err := abi.MakeTopics([]any{anyString})