From b186dedd8d26c64b05cf7e1f354218de1276b9da Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Mon, 16 Oct 2023 09:54:41 +0200 Subject: [PATCH] eth/fetcher: plug goroutine-leak in test --- eth/fetcher/tx_fetcher_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/eth/fetcher/tx_fetcher_test.go b/eth/fetcher/tx_fetcher_test.go index 214025959f..5946cf3747 100644 --- a/eth/fetcher/tx_fetcher_test.go +++ b/eth/fetcher/tx_fetcher_test.go @@ -2007,8 +2007,10 @@ func TestTransactionForgotten(t *testing.T) { }, func(string, []common.Hash) error { return nil }, ) - go fetcher.loop() - // Create a TX which is 5 minutes old, and one which is recent + fetcher.Start() + defer fetcher.Stop() + // Create a TXuno + //which is 5 minutes old, and one which is recent tx1 := types.NewTx(&types.LegacyTx{Nonce: 0}) tx1.SetTime(time.Now().Add(-maxTxUnderpricedTimeout - 1*time.Second)) tx2 := types.NewTx(&types.LegacyTx{Nonce: 1})