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
8aa083bd
Unverified
Commit
8aa083bd
authored
Sep 27, 2020
by
Oran Agra
Committed by
GitHub
Sep 27, 2020
Browse files
Fix new obuf-limits tests to work with TLS (#7848)
Also stabilize new shutdown tests on slow machines (valgrind)
parent
a295770e
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/unit/obuf-limits.tcl
View file @
8aa083bd
...
...
@@ -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
...
...
tests/unit/shutdown.tcl
View file @
8aa083bd
...
...
@@ -30,20 +30,28 @@ start_server {tags {"shutdown"}} {
for
{
set i 0
}
{
$i
< 20
}
{
incr i
}
{
r set $i $i
}
# It will cost 2s
(
20 * 100ms
)
to dump rdb
# It will cost 2s
(
20 * 100ms
)
to dump rdb
r config set rdb-key-save-delay 100000
set pid
[
s process_id
]
set temp_rdb
[
file join
[
lindex
[
r config get dir
]
1
]
temp-$
{
pid
}
.rdb
]
# trigger a shutdown which will save an rdb
exec kill -SIGINT $pid
after 100
# Temp rdb must be existed
assert
{[
file exists $temp_rdb
]}
# Wait for creation of temp rdb
wait_for_condition 50 10
{
[
file exists $temp_rdb
]
}
else
{
fail
"Can't trigger rdb save on shutdown"
}
#
T
emp rdb file must be deleted
#
Insist on immediate shutdown, t
emp rdb file must be deleted
exec kill -SIGINT $pid
after 100
assert
{
!
[
file exists $temp_rdb
]}
# wait for the rdb file to be deleted
wait_for_condition 50 10
{
!
[
file exists $temp_rdb
]
}
else
{
fail
"Can't trigger rdb save on shutdown"
}
}
}
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