From 872c3b73631439d2d923550843ace0a9c81df043 Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Fri, 6 Dec 2024 20:51:44 +1100 Subject: [PATCH] chore(test): unflake TestTraceFilter (#12759) --- itests/eth_transactions_test.go | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/itests/eth_transactions_test.go b/itests/eth_transactions_test.go index a1aaed29923..65072e5ef67 100644 --- a/itests/eth_transactions_test.go +++ b/itests/eth_transactions_test.go @@ -876,12 +876,17 @@ func TestTraceFilter(t *testing.T) { hc := <-ch // current require.Equal(t, store.HCCurrent, hc[0].Type) beforeNullHeight := hc[0].Val.Height() - hc = <-ch // wait for next block - require.Equal(t, store.HCApply, hc[0].Type) - afterNullHeight := hc[0].Val.Height() - require.Greater(t, afterNullHeight, beforeNullHeight+1) - hc = <-ch // one more, so "latest" points to the block after nulls - require.Equal(t, store.HCApply, hc[0].Type) + var blocks int + for { + hc = <-ch // wait for next block + require.Equal(t, store.HCApply, hc[0].Type) + if hc[0].Val.Height() > beforeNullHeight { + blocks++ + if blocks == 2 { // two blocks, so "latest" points to the block after nulls + break + } + } + } // define filter criteria that spans a null round so it has to at lest consider it toBlock = "latest"