Skip to content
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

Merged
merged 1 commit into from
Jan 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions tests/test_bloom_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,3 +364,15 @@ def test_bloom_string_config_set(self):
assert self.client.execute_command('CONFIG SET bf.bloom-tightening-ratio 1.75') == b'ERR (0 < tightening ratio range < 1)'
except ResponseError as e:
assert str(e) == f"CONFIG SET failed (possibly related to argument 'bf.bloom-tightening-ratio') - ERR (0 < tightening ratio range < 1)"

def test_bloom_dump_and_restore(self):
"""
This is a test that validates the bloom data has same debug digest value before and after using restore command
"""
client = self.server.get_new_client()
client.execute_command('BF.INSERT original error 0.001 capacity 2000 items 1')
dump = client.execute_command('DUMP original')
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 restore_digest == dump_digest
Loading