Skip to content

Commit 8889b85

Browse files
committed
Close test dbs
1 parent 935329b commit 8889b85

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/test_helpers.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,12 @@ func setup(t testing.TB, withGenesis bool, invCheckPeriod uint, opts ...wasm.Opt
5959
snapshotDir := filepath.Join(nodeHome, "data", "snapshots")
6060
snapshotDB, err := sdk.NewLevelDB("metadata", snapshotDir)
6161
require.NoError(t, err)
62+
t.Cleanup(func() { snapshotDB.Close() })
6263
snapshotStore, err := snapshots.NewStore(snapshotDB, snapshotDir)
6364
require.NoError(t, err)
6465
baseAppOpts := []func(*bam.BaseApp){bam.SetSnapshotStore(snapshotStore), bam.SetSnapshotKeepRecent(2)}
6566
db := dbm.NewMemDB()
67+
t.Cleanup(func() { db.Close() })
6668
app := NewWasmApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, nodeHome, invCheckPeriod, MakeEncodingConfig(), wasm.EnableAllProposals, EmptyBaseAppOptions{}, opts, baseAppOpts...)
6769
if withGenesis {
6870
return app, NewDefaultGenesisState()

0 commit comments

Comments
 (0)