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>
pull/23357/head
Shihao Xia 3 years ago committed by GitHub
parent 8a24b56331
commit 9e59474e46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      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),

Loading…
Cancel
Save