summaryrefslogtreecommitdiff
path: root/tests/integration
diff options
context:
space:
mode:
authorjudeng <abc3844@126.com>2022-06-23 00:30:22 +0800
committerGitHub <noreply@github.com>2022-06-22 19:30:22 +0300
commit49876158cc2e77bba8e4658fa757891310dc37b6 (patch)
tree0b1e1b3ea76805a9849285ddb5fe53436775a9d4 /tests/integration
parent02acb8fd3a6ec38cabad8dde520ccf0f359bd6ec (diff)
downloadredis-49876158cc2e77bba8e4658fa757891310dc37b6.tar.gz
fix redis-benchmark's bug: check if clients are created successfully in idle mode (#10891)
my maxclients config: ``` redis-cli config get maxclients 1) "maxclients" 2) "4064" ``` Before this bug was fixed, creating 4065 clients appeared to be successful, but only 4064 were actually created``` ``` ./redis-benchmark -c 4065 -I Creating 4065 idle connections and waiting forever (Ctrl+C when done) cients: 4065 ``` now : ``` ./redis-benchmark -c 4065 -I Creating 4065 idle connections and waiting forever (Ctrl+C when done) Error from server: ERR max number of clients reached ./redis-benchmark -c 4064 -I Creating 4064 idle connections and waiting forever (Ctrl+C when done) clients: 4064 ```
Diffstat (limited to 'tests/integration')
-rw-r--r--tests/integration/redis-benchmark.tcl9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/integration/redis-benchmark.tcl b/tests/integration/redis-benchmark.tcl
index 6aa4c7882..ac894aed0 100644
--- a/tests/integration/redis-benchmark.tcl
+++ b/tests/integration/redis-benchmark.tcl
@@ -116,6 +116,15 @@ start_server {tags {"benchmark network external:skip"}} {
# ensure the keyspace has the desired size
assert_match {50} [scan [regexp -inline {keys\=([\d]*)} [r info keyspace]] keys=%d]
}
+
+ test {benchmark: clients idle mode should return error when reached maxclients limit} {
+ set cmd [redisbenchmark $master_host $master_port "-c 2 -I"]
+ set original_maxclients [lindex [r config get maxclients] 1]
+ r config set maxclients 1
+ catch { exec {*}$cmd } error
+ assert_match "*ERR max number of clients reached*" $error
+ r config set maxclients $original_maxclients
+ }
# tls specific tests
if {$::tls} {