summaryrefslogtreecommitdiff
path: root/tests/unit/limits.tcl
diff options
context:
space:
mode:
authorbyte2016 <[email protected]>2018-06-12 19:55:38 +0800
committerbyte2016 <[email protected]>2018-06-12 19:55:38 +0800
commit76f2c13d7c27d7419af79ea0bdc7ab7717b6935b (patch)
treeaa2ca741501d40990b892d504a1cc3b7defe57aa /tests/unit/limits.tcl
Init commit.HEADmaster
Diffstat (limited to 'tests/unit/limits.tcl')
-rw-r--r--tests/unit/limits.tcl16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/unit/limits.tcl b/tests/unit/limits.tcl
new file mode 100644
index 0000000..b37ea9b
--- /dev/null
+++ b/tests/unit/limits.tcl
@@ -0,0 +1,16 @@
+start_server {tags {"limits"} overrides {maxclients 10}} {
+ test {Check if maxclients works refusing connections} {
+ set c 0
+ catch {
+ while {$c < 50} {
+ incr c
+ set rd [redis_deferring_client]
+ $rd ping
+ $rd read
+ after 100
+ }
+ } e
+ assert {$c > 8 && $c <= 10}
+ set e
+ } {*ERR max*reached*}
+}