Skip to content

Commit

Permalink
Adding replay similar to other chain reader test to reduce test flaki…
Browse files Browse the repository at this point in the history
…ness (#14592)

* Adding replay similar to other chain reader tests

* Adding replay similar to other chain reader tests
  • Loading branch information
mateusz-sekara authored Sep 27, 2024
1 parent 2c16f46 commit b09eb30
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ func Test_USDCReader_MessageHashes(t *testing.T) {
emitMessageSent(t, ts, ethereumDomainCCTP, polygonDomainCCTP, 31)
emitMessageSent(t, ts, ethereumDomainCCTP, polygonDomainCCTP, 41)

// Need to replay as sometimes the logs are not picked up by the log poller (?)
// Maybe another situation where chain reader doesn't register filters as expected.
require.NoError(t, ts.lp.Replay(ctx, 1))

tt := []struct {
name string
tokens map[exectypes.MessageTokenID]cciptypes.RampTokenAmount
Expand Down Expand Up @@ -198,7 +202,7 @@ func Test_USDCReader_MessageHashes(t *testing.T) {
}
}
return true
}, tests.WaitTimeout(t), 100*time.Millisecond)
}, tests.WaitTimeout(t), 50*time.Millisecond)
})
}
}
Expand Down Expand Up @@ -286,6 +290,7 @@ func testSetup(ctx context.Context, t *testing.T, readerChain cciptypes.ChainSel
auth: auth,
cl: cl,
reader: cr,
lp: lp,
}
}

Expand All @@ -296,4 +301,5 @@ type testSetupData struct {
auth *bind.TransactOpts
cl client.Client
reader types.ContractReader
lp logpoller.LogPoller
}

0 comments on commit b09eb30

Please sign in to comment.