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 <martin@swende.se>
This commit is contained in:
Shihao XiaandMartin Holst Swende authored and GitHub committed 2021-08-08 15:44:42 +02:00
1 parent 8a24b56331
commit 9e59474e46
1 file changed
+1
+1
View File
@@ -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),