Skip to content

Commit

Permalink
adjust eventually usages (#13556)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmank88 authored Jun 17, 2024
1 parent ba9b0cc commit c0f0c38
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions common/client/poller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down Expand Up @@ -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)
})
}

Expand Down
2 changes: 1 addition & 1 deletion core/services/relay/evm/evmtesting/run_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down

0 comments on commit c0f0c38

Please sign in to comment.