From 1d37b6fad62e40191a7a58488fb2c156acf824a8 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 ea9dc436cfdd..f20e8b1fffb5 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),