From 3332401a0a415e7ec18b23e5c9038b1efc05d451 Mon Sep 17 00:00:00 2001 From: Dimitris Grigoriou Date: Thu, 11 Jan 2024 18:51:59 +0200 Subject: [PATCH] Fix TestIntegration_BlockHistoryEstimator leak (#11741) * Fix TestIntegration_BlockHistoryEstimator leak * Use servicetest.Run --- core/internal/features/features_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/internal/features/features_test.go b/core/internal/features/features_test.go index 8ae6a28a873..da899cef362 100644 --- a/core/internal/features/features_test.go +++ b/core/internal/features/features_test.go @@ -40,6 +40,7 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting/types" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" "github.com/smartcontractkit/chainlink/v2/core/auth" "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" @@ -1319,7 +1320,7 @@ func TestIntegration_BlockHistoryEstimator(t *testing.T) { legacyChains := evmrelay.NewLegacyChainsFromRelayerExtenders(cc) for _, re := range cc.Slice() { - require.NoError(t, re.Start(testutils.Context(t))) + servicetest.Run(t, re) } var newHeads evmtest.RawSub[*evmtypes.Head] select { @@ -1343,6 +1344,7 @@ func TestIntegration_BlockHistoryEstimator(t *testing.T) { elems := args.Get(1).([]rpc.BatchElem) elems[0].Result = &b43 }) + ethClient.On("Close").Return().Once() // Simulate one new head and check the gas price got updated h43 := cltest.Head(43)