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()