]> git.saurik.com Git - redis.git/commitdiff
Test for maxclients.
authorantirez <antirez@gmail.com>
Sun, 8 Apr 2012 09:16:40 +0000 (11:16 +0200)
committerantirez <antirez@gmail.com>
Sun, 8 Apr 2012 09:16:40 +0000 (11:16 +0200)
tests/test_helper.tcl
tests/unit/limits.tcl [new file with mode: 0644]

index 2ec3aad1c16c4bf7679af16fe45bbbdf4331ee12..598a392916538a1900cb711dd3ec31668444bb64 100644 (file)
@@ -38,6 +38,7 @@ set ::all_tests {
     unit/scripting
     unit/maxmemory
     unit/introspection
+    unit/limits
     unit/obuf-limits
     unit/dump
 }
diff --git a/tests/unit/limits.tcl b/tests/unit/limits.tcl
new file mode 100644 (file)
index 0000000..9988983
--- /dev/null
@@ -0,0 +1,13 @@
+start_server {tags {"limits"} overrides {maxclients 10}} {
+    test {Check if maxclients works refusing connections} {
+        set c 0
+        catch {
+            while 1 {
+                incr c
+                redis_deferring_client
+            }
+        } e
+        assert {$c > 8 && $c <= 10}
+        set e
+    } {*ERR max*reached*}
+}