Skip to content

Commit

Permalink
db: use testkeys comparer in TestTracing
Browse files Browse the repository at this point in the history
We need a comparer that supports suffixes to extend the test with
range keys. Note that the testkeys comparer has a worse `Separator`
implementation when there are no suffixes, leading to the slightly
larger index block.
  • Loading branch information
RaduBerinde committed Jul 24, 2024
1 parent 0e23292 commit 54e5ba6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/cockroachdb/fifo"
"github.com/cockroachdb/pebble/internal/base"
"github.com/cockroachdb/pebble/internal/cache"
"github.com/cockroachdb/pebble/internal/testkeys"
"github.com/cockroachdb/pebble/internal/testutils"
"github.com/cockroachdb/pebble/objstorage/objstorageprovider"
"github.com/cockroachdb/pebble/sstable"
Expand Down Expand Up @@ -1447,6 +1448,7 @@ func TestTracing(t *testing.T) {
}
db = testutils.CheckErr(Open("", &Options{
FS: vfs.NewMem(),
Comparer: testkeys.Comparer,
Cache: cache,
LoggerAndTracer: &tracer,
}))
Expand Down
10 changes: 5 additions & 5 deletions testdata/tracing
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ hello
----
reading footer of 53 bytes took 5ms
reading block of 37 bytes took 5ms (<redacted>)
reading block of 419 bytes took 5ms (<redacted>)
reading block of 27 bytes took 5ms (<redacted>)
reading block of 417 bytes took 5ms (<redacted>)
reading block of 31 bytes took 5ms (<redacted>)
reading block of 32 bytes took 5ms (<redacted>)
hello:foo

Expand All @@ -21,20 +21,20 @@ hello:foo
iter
seek-ge hello
----
reading block of 27 bytes took 5ms (<redacted>)
reading block of 31 bytes took 5ms (<redacted>)
reading block of 32 bytes took 5ms (<redacted>)
hello: (foo, .)

snapshot-iter
seek-ge hello
----
reading block of 27 bytes took 5ms (<redacted>)
reading block of 31 bytes took 5ms (<redacted>)
reading block of 32 bytes took 5ms (<redacted>)
hello: (foo, .)

indexed-batch-iter
seek-ge hello
----
reading block of 27 bytes took 5ms (<redacted>)
reading block of 31 bytes took 5ms (<redacted>)
reading block of 32 bytes took 5ms (<redacted>)
hello: (foo, .)

0 comments on commit 54e5ba6

Please sign in to comment.