Skip to content

Commit

Permalink
fix(store/v2): update PM Test (#18501)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderbez authored Nov 17, 2023
1 parent c207163 commit 9512069
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions store/pruning/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ func (m *Manager) Prune(height uint64) {
}()
}
default:
m.logger.Debug("storage pruning is still running; skipping", "version", pruneHeight)
}
}
}
Expand Down
15 changes: 8 additions & 7 deletions store/pruning/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,17 @@ func TestPruningTestSuite(t *testing.T) {
}

func (s *PruningTestSuite) SetupTest() {
noopLog := log.NewNopLogger()
logger := log.NewNopLogger()
if testing.Verbose() {
logger = log.NewTestLogger(s.T())
}

ss, err := sqlite.New(s.T().TempDir())
s.Require().NoError(err)

sc := iavl.NewIavlTree(dbm.NewMemDB(), noopLog, iavl.DefaultConfig())
sc := iavl.NewIavlTree(dbm.NewMemDB(), log.NewNopLogger(), iavl.DefaultConfig())

s.manager = NewManager(noopLog, ss, sc)
s.manager = NewManager(logger, ss, sc)
s.ss = ss
s.sc = sc
}
Expand All @@ -44,10 +47,8 @@ func (s *PruningTestSuite) TearDownTest() {
}

func (s *PruningTestSuite) TestPruning() {
s.T().SkipNow()

s.manager.SetCommitmentOptions(Options{4, 2, true})
s.manager.SetStorageOptions(Options{3, 3, false})
s.manager.SetStorageOptions(Options{3, 3, true})
s.manager.Start()

latestVersion := uint64(100)
Expand Down Expand Up @@ -80,7 +81,7 @@ func (s *PruningTestSuite) TestPruning() {

// check the store for the version 50
val, err = s.ss.Get("", 50, []byte("key"))
s.Require().NoError(err)
s.Require().Error(err)
s.Require().Nil(val)

// check the commitment for the version 96
Expand Down

0 comments on commit 9512069

Please sign in to comment.