Skip to content

Commit

Permalink
Use block committed before event as a filter to verify event is prese…
Browse files Browse the repository at this point in the history
…nt on chain (#13713)
  • Loading branch information
dhaidashenko authored Jul 17, 2024
1 parent b3c93a7 commit 6d2b5fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/wet-wasps-hide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

Fix TestIntegration_KeeperPluginLogUpkeep_ErrHandler flaky test #internal
3 changes: 2 additions & 1 deletion core/services/ocr2/plugins/ocr2keeper/integration_21_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1166,6 +1166,7 @@ func (c *feedLookupUpkeepController) EmitEvents(
ctx := testutils.Context(t)

for i := 0; i < count && ctx.Err() == nil; i++ {
blockBeforeOrder, _ := backend.BlockByHash(ctx, backend.Commit())
_, err := c.protocol.ExecuteLimitOrder(c.protocolOwner, big.NewInt(1000), big.NewInt(10000), c.logSrcAddr)
require.NoError(t, err, "no error expected from limit order exec")

Expand All @@ -1182,7 +1183,7 @@ func (c *feedLookupUpkeepController) EmitEvents(
iter, _ := c.protocol.FilterLimitOrderExecuted(
&bind.FilterOpts{
Context: testutils.Context(t),
Start: block.NumberU64() - 1,
Start: blockBeforeOrder.NumberU64() - 1,
},
[]*big.Int{big.NewInt(1000)},
[]*big.Int{big.NewInt(10000)},
Expand Down

0 comments on commit 6d2b5fa

Please sign in to comment.