From 52ecb85f78a82ea7e0d9732b157f6ceea43ef840 Mon Sep 17 00:00:00 2001 From: Alex Peters Date: Tue, 29 Nov 2022 17:30:59 +0100 Subject: [PATCH] Close test dbs --- app/test_helpers.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/test_helpers.go b/app/test_helpers.go index 8c3e8c11e5..c48425f6ba 100644 --- a/app/test_helpers.go +++ b/app/test_helpers.go @@ -59,10 +59,12 @@ func setup(t testing.TB, withGenesis bool, invCheckPeriod uint, opts ...wasm.Opt snapshotDir := filepath.Join(nodeHome, "data", "snapshots") snapshotDB, err := sdk.NewLevelDB("metadata", snapshotDir) require.NoError(t, err) + t.Cleanup(func() { snapshotDB.Close() }) snapshotStore, err := snapshots.NewStore(snapshotDB, snapshotDir) require.NoError(t, err) baseAppOpts := []func(*bam.BaseApp){bam.SetSnapshotStore(snapshotStore), bam.SetSnapshotKeepRecent(2)} db := dbm.NewMemDB() + t.Cleanup(func() { db.Close() }) app := NewWasmApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, nodeHome, invCheckPeriod, MakeEncodingConfig(), wasm.EnableAllProposals, EmptyBaseAppOptions{}, opts, baseAppOpts...) if withGenesis { return app, NewDefaultGenesisState()