summaryrefslogtreecommitdiff
path: root/tests/support
diff options
context:
space:
mode:
authorBinbin <binloveplay1314@qq.com>2023-03-15 17:07:04 +0800
committerGitHub <noreply@github.com>2023-03-15 11:07:04 +0200
commit70b2c4f5fd4dc5ca592aad2128d0fd43e1e8f82c (patch)
tree0419189f6fbe6338f695dbea144486fadf5a4edb /tests/support
parent5360350e4aeaa2c7498be4af29aee449f0ee49ad (diff)
downloadredis-70b2c4f5fd4dc5ca592aad2128d0fd43e1e8f82c.tar.gz
Fix WAITAOF reply when using last_offset and last_numreplicas (#11917)
WAITAOF wad added in #11713, its return is an array. But forget to handle WAITAOF in last_offset and last_numreplicas, causing WAITAOF to return a WAIT like reply. Tests was added to validate that case (both WAIT and WAITAOF). This PR also refactored processClientsWaitingReplicas a bit for better maintainability and readability.
Diffstat (limited to 'tests/support')
-rw-r--r--tests/support/util.tcl4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/support/util.tcl b/tests/support/util.tcl
index 062f33a14..236fad314 100644
--- a/tests/support/util.tcl
+++ b/tests/support/util.tcl
@@ -886,9 +886,9 @@ proc wait_for_blocked_client {{idx 0}} {
}
}
-proc wait_for_blocked_clients_count {count {maxtries 100} {delay 10}} {
+proc wait_for_blocked_clients_count {count {maxtries 100} {delay 10} {idx 0}} {
wait_for_condition $maxtries $delay {
- [s blocked_clients] == $count
+ [s $idx blocked_clients] == $count
} else {
fail "Timeout waiting for blocked clients"
}