-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add dump and restore test #42
Conversation
tests/test_bloom_basic.py
Outdated
dump = client.execute_command('DUMP dump') | ||
assert client.execute_command('DEL dump') == 1 | ||
client.execute_command('RESTORE', 'dump', 0, dump) | ||
assert client.execute_command('BF.EXISTS dump 1') == 1 |
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.
Can we run the DEBUG command and check the DEBUG result on the object before and after restore?
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.
Sure, will check the Debug commands before and after
tests/test_bloom_basic.py
Outdated
client = self.server.get_new_client() | ||
client.execute_command('BF.INSERT dump error 0.001 capacity 2000 items 1') | ||
dump = client.execute_command('DUMP dump') | ||
assert client.execute_command('DEL dump') == 1 |
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.
Let's skip out on the deletion for this test
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.
Based on this: https://redis.io/docs/latest/commands/restore/
I thought we want to delete the key, then restore the deleted key.
Will update accordingly to just dump and restore the key rather than deleting
7aeb537
to
e4291ff
Compare
tests/test_bloom_basic.py
Outdated
dump_digest = client.execute_command('DEBUG DIGEST-VALUE original') | ||
client.execute_command('RESTORE', 'copy', 0, dump) | ||
restore_digest = client.execute_command('DEBUG DIGEST-VALUE copy') | ||
assert client.execute_command('BF.EXISTS copy 1') == 1 |
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.
Do you think there would be any benefit of comparing the bf.info values as well or is this covered by comparing the digest value?
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.
Yes, we can remove this. DIGEST should cover it
Signed-off-by: Nihal Mehta <[email protected]>
Created a python test that tests bloom data using dump and restore commands after deleting a key and making sure the key exists after restoring