summaryrefslogtreecommitdiff
path: root/tests/support
diff options
context:
space:
mode:
Diffstat (limited to 'tests/support')
-rw-r--r--tests/support/redis.tcl4
-rw-r--r--tests/support/server.tcl8
-rw-r--r--tests/support/util.tcl4
3 files changed, 14 insertions, 2 deletions
diff --git a/tests/support/redis.tcl b/tests/support/redis.tcl
index 5743be5f4..edcc1fb48 100644
--- a/tests/support/redis.tcl
+++ b/tests/support/redis.tcl
@@ -188,6 +188,10 @@ proc ::redis::__method__readraw {id fd val} {
set ::redis::readraw($id) $val
}
+proc ::redis::__method__readingraw {id fd} {
+ return $::redis::readraw($id)
+}
+
proc ::redis::__method__attributes {id fd} {
set _ $::redis::attributes($id)
}
diff --git a/tests/support/server.tcl b/tests/support/server.tcl
index b06bd73ba..9d0c4510d 100644
--- a/tests/support/server.tcl
+++ b/tests/support/server.tcl
@@ -684,6 +684,14 @@ proc start_server {options {code undefined}} {
}
}
+# Start multiple servers with the same options, run code, then stop them.
+proc start_multiple_servers {num options code} {
+ for {set i 0} {$i < $num} {incr i} {
+ set code [list start_server $options $code]
+ }
+ uplevel 1 $code
+}
+
proc restart_server {level wait_ready rotate_logs {reconnect 1} {shutdown sigterm}} {
set srv [lindex $::servers end+$level]
if {$shutdown ne {sigterm}} {
diff --git a/tests/support/util.tcl b/tests/support/util.tcl
index 46c9654c8..4ad96ab10 100644
--- a/tests/support/util.tcl
+++ b/tests/support/util.tcl
@@ -122,7 +122,7 @@ proc wait_replica_online r {
wait_for_condition 50 100 {
[string match "*slave0:*,state=online*" [$r info replication]]
} else {
- fail "replica didn't sync in time"
+ fail "replica didn't online in time"
}
}
@@ -130,7 +130,7 @@ proc wait_for_ofs_sync {r1 r2} {
wait_for_condition 50 100 {
[status $r1 master_repl_offset] eq [status $r2 master_repl_offset]
} else {
- fail "replica didn't sync in time"
+ fail "replica offset didn't match in time"
}
}