Skip to content

Commit

Permalink
replace with tests.WaitTimeout(t)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xsuryansh committed Feb 24, 2025
1 parent 8621c4a commit d3f50e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions integration-tests/smoke/ccip/ccip_reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1059,21 +1059,21 @@ func TestCCIPReader_DiscoverContracts(t *testing.T) {
err = reader.Sync(ctx, onRampContractMapping)
require.NoError(t, err)

// Since config poller has default refresh interval of 30s, we need to wait for the contract to be discovered
require.Eventually(t, func() bool {
contractAddresses, err = reader.DiscoverContracts(ctx, []cciptypes.ChainSelector{chainS1, chainD})
if err != nil {
return false
}

// Check if router and FeeQuoter addresses on source chain are now discovered
// Adding 1 sec buffer to avoid flakes
routerS1, routerExists := contractAddresses[consts.ContractNameRouter][chainS1]
feeQuoterS1, feeQuoterExists := contractAddresses[consts.ContractNameFeeQuoter][chainS1]

return routerExists && feeQuoterExists &&
bytes.Equal(routerS1, destinationChainConfigArgs[0].Router.Bytes()) &&
bytes.Equal(feeQuoterS1, onRampS1DynamicConfig.FeeQuoter.Bytes())
}, (30+1)*time.Second, 100*time.Millisecond, "Router and FeeQuoter addresses were not discovered on source chain in time")
}, tests.WaitTimeout(t), 100*time.Millisecond, "Router and FeeQuoter addresses were not discovered on source chain in time")

// Final assertions again for completeness:
contractAddresses, err = reader.DiscoverContracts(ctx, []cciptypes.ChainSelector{chainS1, chainD})
Expand Down

0 comments on commit d3f50e6

Please sign in to comment.