Skip to content

Commit

Permalink
fix(Test): improve the params in BenchmarkDbGrowth (#1967)
Browse files Browse the repository at this point in the history
It seems some parameter settings have been changed in the past. As a
result, some tests (at least one) lose the ability to test what they
want to test.
For `BenchmarkDbGrowth`, current default value of `ValueThreshold` makes
no vlog will be created and current default value of `MemTableSize`
makes no memtable will be flushed which means no compaction and thus no
vlog gc will be performed.

## Solution
Setting `ValueThreshold` be 1024 and `MemTableSize` be 1MB in this case
seems to be fine.

Signed-off-by: SpadeA-Tang <[email protected]>
  • Loading branch information
SpadeA-Tang authored Jun 8, 2023
1 parent 8671f9d commit d85287b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,8 @@ func BenchmarkDbGrowth(b *testing.B) {
opts.NumVersionsToKeep = 1
opts.NumLevelZeroTables = 1
opts.NumLevelZeroTablesStall = 2
opts.ValueThreshold = 1024
opts.MemTableSize = 1 << 20
db, err := Open(opts)
require.NoError(b, err)
for numWrites := 0; numWrites < maxWrites; numWrites++ {
Expand Down

0 comments on commit d85287b

Please sign in to comment.