summaryrefslogtreecommitdiff
path: root/tests/support
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/support
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/support')
-rw-r--r--tests/support/test.tcl6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/support/test.tcl b/tests/support/test.tcl
index 2fe52f475..68180bea4 100644
--- a/tests/support/test.tcl
+++ b/tests/support/test.tcl
@@ -24,9 +24,11 @@ proc assert_no_match {pattern value} {
}
}
-proc assert_match {pattern value {detail ""}} {
+proc assert_match {pattern value {detail ""} {context ""}} {
if {![string match $pattern $value]} {
- set context "(context: [info frame -1])"
+ if {$context eq ""} {
+ set context "(context: [info frame -1])"
+ }
error "assertion:Expected '$value' to match '$pattern' $context $detail"
}
}