From 9e59474e46f383cd2eace981d498dd7176ea1319 Mon Sep 17 00:00:00 2001 From: Shihao Xia Date: Sun, 8 Aug 2021 09:44:42 -0400 Subject: [PATCH] core/rawdb: close database in test to avoid goroutine leak (#23287) * add db close to avoid goroutine leak * core/rawdb: move close to defer Co-authored-by: Martin Holst Swende --- core/rawdb/accessors_chain_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/core/rawdb/accessors_chain_test.go b/core/rawdb/accessors_chain_test.go index ea9dc436c..f20e8b1ff 100644 --- a/core/rawdb/accessors_chain_test.go +++ b/core/rawdb/accessors_chain_test.go @@ -444,6 +444,7 @@ func TestAncientStorage(t *testing.T) { if err != nil { t.Fatalf("failed to create database with ancient backend") } + defer db.Close() // Create a test block block := types.NewBlockWithHeader(&types.Header{ Number: big.NewInt(0),