Unverified Commit 3a955d9a authored by sundb's avatar sundb Committed by GitHub
Browse files

Fix ouput buffer limit test (#8803)

The tail size of c->reply is 16kb, but in the test only publish a
few chars each time, due to a change in #8699, the obuf limit
is now checked a new memory allocation is made, so this test
would have sometimes failed to trigger a soft limit disconnection
in time.

The solution is to write bigger payloads to the output buffer, but
still limit their rate (not more than 100k/s).
parent 0413fbc7
...@@ -31,7 +31,11 @@ start_server {tags {"obuf-limits"}} { ...@@ -31,7 +31,11 @@ start_server {tags {"obuf-limits"}} {
set start_time 0 set start_time 0
set time_elapsed 0 set time_elapsed 0
while 1 { while 1 {
r publish foo bar if {$start_time != 0} {
# Slow down loop when omen has reached the limit.
after 10
}
r publish foo [string repeat "x" 1000]
set clients [split [r client list] "\r\n"] set clients [split [r client list] "\r\n"]
set c [split [lindex $clients 1] " "] set c [split [lindex $clients 1] " "]
if {![regexp {omem=([0-9]+)} $c - omem]} break if {![regexp {omem=([0-9]+)} $c - omem]} break
...@@ -57,7 +61,11 @@ start_server {tags {"obuf-limits"}} { ...@@ -57,7 +61,11 @@ start_server {tags {"obuf-limits"}} {
set start_time 0 set start_time 0
set time_elapsed 0 set time_elapsed 0
while 1 { while 1 {
r publish foo bar if {$start_time != 0} {
# Slow down loop when omen has reached the limit.
after 10
}
r publish foo [string repeat "x" 1000]
set clients [split [r client list] "\r\n"] set clients [split [r client list] "\r\n"]
set c [split [lindex $clients 1] " "] set c [split [lindex $clients 1] " "]
if {![regexp {omem=([0-9]+)} $c - omem]} break if {![regexp {omem=([0-9]+)} $c - omem]} break
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment