summaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorBinbin <binloveplay1314@qq.com>2023-03-09 04:39:54 +0800
committerGitHub <noreply@github.com>2023-03-08 22:39:54 +0200
commita7c9e5053a96e66d77d243702bbadeb95c6a640d (patch)
tree626777b56bb40e634ea7aafc758511bbcca5cd41 /tests/unit
parent312654d5be3e7de60e6a7883d7a8f2f8120dfab6 (diff)
downloadredis-a7c9e5053a96e66d77d243702bbadeb95c6a640d.tar.gz
Fix test and improve assert_replication_stream print the whole stream (#11793)
This PR has two parts: 1. Fix flaky test case, the previous tests set a lot of volatile keys, it injects an unexpected DEL command into the replication stream during the later test, causing it to fail. Add a flushall to avoid it. 2. Improve assert_replication_stream, now it can print the whole stream rather than just the failing line.
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/expire.tcl3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/unit/expire.tcl b/tests/unit/expire.tcl
index 22a9f73bb..5ee4488b3 100644
--- a/tests/unit/expire.tcl
+++ b/tests/unit/expire.tcl
@@ -628,6 +628,9 @@ start_server {tags {"expire"}} {
} {-1} {needs:debug}
test {GETEX propagate as to replica as PERSIST, DEL, or nothing} {
+ # In the above tests, many keys with random expiration times are set, flush
+ # the DBs to avoid active expiry kicking in and messing the replication streams.
+ r flushall
set repl [attach_to_replication_stream]
r set foo bar EX 100
r getex foo PERSIST