Added test for client output buffer limit (hard limit).
This commit is contained in:
parent
c715c9b8bf
commit
efc8f6c1a2
@ -35,6 +35,7 @@ set ::all_tests {
|
|||||||
unit/scripting
|
unit/scripting
|
||||||
unit/maxmemory
|
unit/maxmemory
|
||||||
unit/introspection
|
unit/introspection
|
||||||
|
unit/obuf-limits
|
||||||
}
|
}
|
||||||
# Index to the next test to run in the ::all_tests list.
|
# Index to the next test to run in the ::all_tests list.
|
||||||
set ::next_test 0
|
set ::next_test 0
|
||||||
|
21
tests/unit/obuf-limits.tcl
Normal file
21
tests/unit/obuf-limits.tcl
Normal file
@ -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
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user