-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
storage: add TestKeySchema_RandomKeys #133077
Conversation
it.InitOnce(keySchema, EngineKeyCompare, EngineKeySplit, nil) | ||
require.NoError(t, it.Init(&dec, block.NoTransforms)) | ||
for k, kv := 0, it.First(); kv != nil; k, kv = k+1, it.Next() { | ||
require.True(t, EngineKeyEqual(keys[k], kv.K.UserKey)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we compare for exact equality? We assume that the keys will be identical (or at least never longer) when we preallocate the max-key-length buffer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added an assertion on the length. This test will generate MVCC keys with the synthetic bit so we can't assert exact equality
Add a randomized test that constructs random keys, writes them to a Pebble columnar block, iterates over the block and asserts that the keys are semantically equal to the original generated keys. Epic: none Release note: none
b1dcf6c
to
abfe387
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @itsbilal)
pkg/storage/pebble_key_schema_test.go
line 349 at r1 (raw file):
Previously, jbowens (Jackson Owens) wrote…
Added an assertion on the length. This test will generate MVCC keys with the synthetic bit so we can't assert exact equality
👍
TFTR! bors r=RaduBerinde |
Add a randomized test that constructs random keys, writes them to a Pebble columnar block, iterates over the block and asserts that the keys are semantically equal to the original generated keys.
Epic: none
Release note: none