From 535d2795c6e9b66315fe066c7dbaf91977d3e913 Mon Sep 17 00:00:00 2001 From: Dmytro Haidashenko <34754799+dhaidashenko@users.noreply.github.com> Date: Mon, 8 Jul 2024 13:54:59 +0200 Subject: [PATCH] Fix TestHeadTracker_CallsHeadTrackableCallbacks flaky test (#13712) --- .changeset/tricky-seas-invite.md | 5 +++++ core/chains/evm/headtracker/head_tracker_test.go | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 .changeset/tricky-seas-invite.md diff --git a/.changeset/tricky-seas-invite.md b/.changeset/tricky-seas-invite.md new file mode 100644 index 00000000000..f109a2d8f93 --- /dev/null +++ b/.changeset/tricky-seas-invite.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +Fix TestHeadTracker_CallsHeadTrackableCallbacks flaky test #internal diff --git a/core/chains/evm/headtracker/head_tracker_test.go b/core/chains/evm/headtracker/head_tracker_test.go index 81ba3ea85f0..21ff1b1a929 100644 --- a/core/chains/evm/headtracker/head_tracker_test.go +++ b/core/chains/evm/headtracker/head_tracker_test.go @@ -330,7 +330,6 @@ func TestHeadTracker_Start(t *testing.T) { func TestHeadTracker_CallsHeadTrackableCallbacks(t *testing.T) { t.Parallel() - g := gomega.NewWithT(t) db := pgtest.NewSqlxDB(t) config := testutils.NewTestChainScopedConfig(t, nil) @@ -360,7 +359,7 @@ func TestHeadTracker_CallsHeadTrackableCallbacks(t *testing.T) { headers := <-chchHeaders headers.TrySend(&evmtypes.Head{Number: 1, Hash: utils.NewHash(), EVMChainID: ubig.New(testutils.FixtureChainID)}) - g.Eventually(checker.OnNewLongestChainCount).Should(gomega.Equal(int32(1))) + tests.AssertEventually(t, func() bool { return checker.OnNewLongestChainCount() == 1 }) ht.Stop(t) assert.Equal(t, int32(1), checker.OnNewLongestChainCount())