From 83d7f426d1652b30855a61aba7fd86f5e294d279 Mon Sep 17 00:00:00 2001 From: Darioush Jalali Date: Wed, 5 Jul 2023 23:56:42 -0700 Subject: [PATCH] core: stop chain when tests are finished (#27660) core (blockchain_test): add chain.Stop() to tests --- core/blockchain_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/blockchain_test.go b/core/blockchain_test.go index 5ec685c99..e626dbb5f 100644 --- a/core/blockchain_test.go +++ b/core/blockchain_test.go @@ -4129,6 +4129,7 @@ func testCreateThenDelete(t *testing.T, config *params.ChainConfig) { if err != nil { t.Fatalf("failed to create tester chain: %v", err) } + defer chain.Stop() // Import the blocks for _, block := range blocks { if _, err := chain.InsertChain([]*types.Block{block}); err != nil { @@ -4215,6 +4216,7 @@ func TestTransientStorageReset(t *testing.T) { if err != nil { t.Fatalf("failed to create tester chain: %v", err) } + defer chain.Stop() // Import the blocks if _, err := chain.InsertChain(blocks); err != nil { t.Fatalf("failed to insert into chain: %v", err) @@ -4309,6 +4311,7 @@ func TestEIP3651(t *testing.T) { if err != nil { t.Fatalf("failed to create tester chain: %v", err) } + defer chain.Stop() if n, err := chain.InsertChain(blocks); err != nil { t.Fatalf("block %d: failed to insert into chain: %v", n, err) }