Rename in pruning test (#20795)

This commit is contained in:
Hieu Vu 2024-06-27 17:40:05 +07:00 committed by GitHub
parent 9e89aace91
commit e3c5b25e15
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -64,7 +64,7 @@ func (s *RootStoreTestSuite) SetupTest() {
s.rootStore = rs
}
func (s *RootStoreTestSuite) newStoreWithPruneConfig(config *store.PruneOptions) {
func (s *RootStoreTestSuite) newStoreWithPruneConfig(config *store.PruningOption) {
noopLog := log.NewNopLogger()
sqliteDB, err := sqlite.New(s.T().TempDir())
@ -361,24 +361,27 @@ func (s *RootStoreTestSuite) TestPrune() {
testCases := []struct {
name string
numVersions int64
po store.PruneOptions
po store.PruningOption
deleted []uint64
saved []uint64
}{
{"prune nothing", 10, *store.DefaultPruneOptions(), nil, []uint64{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}},
{"prune everything", 12, store.PruneOptions{
{"prune nothing", 10, store.PruningOption{
KeepRecent: 0,
Interval: 0,
}, nil, []uint64{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}},
{"prune everything", 12, store.PruningOption{
KeepRecent: 1,
Interval: 10,
}, []uint64{1, 2, 3, 4, 5, 6, 7, 8}, []uint64{9, 10, 11, 12}},
{"prune some; no batch", 10, store.PruneOptions{
{"prune some; no batch", 10, store.PruningOption{
KeepRecent: 2,
Interval: 1,
}, []uint64{1, 2, 3, 4, 6, 5, 7}, []uint64{8, 9, 10}},
{"prune some; small batch", 10, store.PruneOptions{
{"prune some; small batch", 10, store.PruningOption{
KeepRecent: 2,
Interval: 3,
}, []uint64{1, 2, 3, 4, 5, 6}, []uint64{7, 8, 9, 10}},
{"prune some; large batch", 10, store.PruneOptions{
{"prune some; large batch", 10, store.PruningOption{
KeepRecent: 2,
Interval: 11,
}, nil, []uint64{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}},
@ -439,7 +442,7 @@ func (s *RootStoreTestSuite) TestMultiStore_Pruning_SameHeightsTwice() {
interval uint64 = 10
)
s.newStoreWithPruneConfig(&store.PruneOptions{
s.newStoreWithPruneConfig(&store.PruningOption{
KeepRecent: keepRecent,
Interval: interval,
})
@ -491,7 +494,7 @@ func (s *RootStoreTestSuite) TestMultiStore_PruningRestart() {
cs := corestore.NewChangeset()
cs.Add(testStoreKeyBytes, []byte("key"), []byte("val"), false)
pruneOpt := &store.PruneOptions{
pruneOpt := &store.PruningOption{
KeepRecent: 2,
Interval: 11,
}