diff options
author | Oran Agra <oran@redislabs.com> | 2020-09-27 17:13:33 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-27 17:13:33 +0300 |
commit | 8aa083bd283963f60c46eb6156e7aacca3c853c3 (patch) | |
tree | d414ea50c4e9358b82d0986db776643a8dde74b1 /tests/unit/obuf-limits.tcl | |
parent | a295770e32b4bd71ff560c5ec7bc5c0ad12bf068 (diff) | |
download | redis-8aa083bd283963f60c46eb6156e7aacca3c853c3.tar.gz |
Fix new obuf-limits tests to work with TLS (#7848)
Also stabilize new shutdown tests on slow machines (valgrind)
Diffstat (limited to 'tests/unit/obuf-limits.tcl')
-rw-r--r-- | tests/unit/obuf-limits.tcl | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/tests/unit/obuf-limits.tcl b/tests/unit/obuf-limits.tcl index 20ba32fd5..456d3ac82 100644 --- a/tests/unit/obuf-limits.tcl +++ b/tests/unit/obuf-limits.tcl @@ -99,6 +99,8 @@ start_server {tags {"obuf-limits"}} { assert_equal {} [read $fd] } + # Note: This test assumes that what's written with one write, will be read by redis in one read. + # this assumption is wrong, but seem to work empirically (for now) test {No response for multi commands in pipeline if client output buffer limit is enforced} { r config set client-output-buffer-limit {normal 100000 0 0} set value [string repeat "x" 10000] @@ -107,20 +109,26 @@ start_server {tags {"obuf-limits"}} { set rd2 [redis_deferring_client] $rd2 client setname multicommands assert_equal "OK" [$rd2 read] - # Let redis sleep 2s firstly - $rd1 debug sleep 2 + + # Let redis sleep 1s firstly + $rd1 debug sleep 1 $rd1 flush after 100 + # Create a pipeline of commands that will be processed in one socket read. + # It is important to use one write, in TLS mode independant writes seem + # to wait for response from the server. # Total size should be less than OS socket buffer, redis can # execute all commands in this pipeline when it wakes up. + set buf "" for {set i 0} {$i < 15} {incr i} { - $rd2 set $i $i - $rd2 get $i - $rd2 del $i + append buf "set $i $i\r\n" + append buf "get $i\r\n" + append buf "del $i\r\n" # One bigkey is 10k, total response size must be more than 100k - $rd2 get bigkey + append buf "get bigkey\r\n" } + $rd2 write $buf $rd2 flush after 100 |