Skip to content

Commit

Permalink
fix: TestOfferSnapshot flake (#3957)
Browse files Browse the repository at this point in the history
Closes #3956
  • Loading branch information
rootulp authored Oct 11, 2024
1 parent ca222a8 commit d4ccdfe
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package app_test

import (
"encoding/json"
"os"
"path/filepath"
"testing"

Expand Down Expand Up @@ -160,7 +161,15 @@ func createTestApp(t *testing.T) *app.App {
config := encoding.MakeConfig(app.ModuleEncodingRegisters...)
upgradeHeight := int64(3)
snapshotDir := filepath.Join(t.TempDir(), "data", "snapshots")
t.Cleanup(func() {
err := os.RemoveAll(snapshotDir)
require.NoError(t, err)
})
snapshotDB, err := tmdb.NewDB("metadata", tmdb.GoLevelDBBackend, snapshotDir)
t.Cleanup(func() {
err := snapshotDB.Close()
require.NoError(t, err)
})
require.NoError(t, err)
snapshotStore, err := snapshots.NewStore(snapshotDB, snapshotDir)
require.NoError(t, err)
Expand Down

0 comments on commit d4ccdfe

Please sign in to comment.