mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2024-12-14 11:58:02 +00:00
Fix benchmark (#3017)
* fix(benchmark): fix lag check Signed-off-by: adi_holden <adi@dragonflydb.io> --------- Signed-off-by: adi_holden <adi@dragonflydb.io>
This commit is contained in:
parent
7d522fd00b
commit
186ff31e29
1 changed files with 13 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
import redis
|
||||
import re
|
||||
import time
|
||||
|
||||
|
||||
def main():
|
||||
|
@ -14,9 +14,20 @@ def main():
|
|||
info = client.info("replication")
|
||||
assert info["role"] == "master"
|
||||
replication_state = info["slave0"]
|
||||
assert replication_state["lag"] == 0, f"Lag is bad, expected 0, got {replication_state['lag']}"
|
||||
assert replication_state["state"] == "stable_sync"
|
||||
|
||||
def is_zero_lag(replication_state):
|
||||
return replication_state["lag"] == 0
|
||||
|
||||
# Wait for 10 seconds for lag to be zero
|
||||
for _ in range(10):
|
||||
if is_zero_lag(replication_state):
|
||||
break
|
||||
time.sleep(1)
|
||||
replication_state = client.info("replication")["slave0"]
|
||||
|
||||
assert replication_state["lag"] == 0, f"Lag is bad, expected 0, got {replication_state['lag']}"
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
Loading…
Reference in a new issue