diff options
author | antirez <antirez@gmail.com> | 2012-01-25 18:11:04 +0100 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2012-01-25 18:11:04 +0100 |
commit | efc8f6c1a2366fd374ffd0b39138bea02bda2e9c (patch) | |
tree | 9b648a763f0ca72660f4256c37edb664298ed3f9 /tests/unit/obuf-limits.tcl | |
parent | c715c9b8bfbd83022502e29ae72be7f0eae1a3da (diff) | |
download | redis-efc8f6c1a2366fd374ffd0b39138bea02bda2e9c.tar.gz |
Added test for client output buffer limit (hard limit).
Diffstat (limited to 'tests/unit/obuf-limits.tcl')
-rw-r--r-- | tests/unit/obuf-limits.tcl | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/unit/obuf-limits.tcl b/tests/unit/obuf-limits.tcl new file mode 100644 index 000000000..e687752c0 --- /dev/null +++ b/tests/unit/obuf-limits.tcl @@ -0,0 +1,21 @@ +start_server {tags {"obuf-limits"}} { + test {Test that client output buffer hard limit is enforced} { + r config set client-output-buffer-limit {pubsub 100000 0 0} + set rd1 [redis_deferring_client] + + $rd1 subscribe foo + set reply [$rd1 read] + assert {$reply eq "subscribe foo 1"} + + set omem 0 + while 1 { + r publish foo bar + set clients [split [r client list] "\r\n"] + set c [split [lindex $clients 1] " "] + if {![regexp {omem=([0-9]+)} $c - omem]} break + if {$omem > 200000} break + } + assert {$omem >= 100000 && $omem < 200000} + $rd1 close + } +} |