Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
efc8f6c1
Commit
efc8f6c1
authored
Jan 25, 2012
by
antirez
Browse files
Added test for client output buffer limit (hard limit).
parent
c715c9b8
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/test_helper.tcl
View file @
efc8f6c1
...
@@ -35,6 +35,7 @@ set ::all_tests {
...
@@ -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
...
...
tests/unit/obuf-limits.tcl
0 → 100644
View file @
efc8f6c1
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
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment