diff --git a/core/chains/evm/logpoller/helper_test.go b/core/chains/evm/logpoller/helper_test.go index 947a839521c..7f84861df0d 100644 --- a/core/chains/evm/logpoller/helper_test.go +++ b/core/chains/evm/logpoller/helper_test.go @@ -118,11 +118,19 @@ func SetupTH(t testing.TB, opts logpoller.Opts) TestHarness { opts.PollPeriod = 1 * time.Hour } lp := logpoller.NewLogPoller(o, esc, lggr, headTracker, opts) + + pendingNonce, err := backend.Client().PendingNonceAt(testutils.Context(t), owner.From) + require.NoError(t, err) + + owner.Nonce = big.NewInt(int64(pendingNonce)) emitterAddress1, _, emitter1, err := log_emitter.DeployLogEmitter(owner, backend.Client()) require.NoError(t, err) + + owner.Nonce.Add(owner.Nonce, big.NewInt(1)) // Avoid race where DeployLogEmitter returns before PendingNonce has been incremented emitterAddress2, _, emitter2, err := log_emitter.DeployLogEmitter(owner, backend.Client()) require.NoError(t, err) backend.Commit() + owner.Nonce = nil // Just use pending nonce after this return TestHarness{ Lggr: lggr,