Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
843a13e8
Unverified
Commit
843a13e8
authored
Oct 22, 2020
by
Yossi Gottlieb
Committed by
GitHub
Oct 22, 2020
Browse files
Add a --no-latency tests flag. (#7939)
Useful for running tests on systems which may be way slower than usual.
parent
6cf23d66
Changes
5
Hide whitespace changes
Inline
Side-by-side
.github/workflows/daily.yml
View file @
843a13e8
...
...
@@ -200,7 +200,7 @@ jobs:
run
:
make
-
name
:
test
run
:
|
./runtest --accurate --verbose
./runtest --accurate --verbose
--no-latency
-
name
:
module api test
run
:
./runtest-moduleapi --verbose
-
name
:
sentinel tests
...
...
tests/integration/replication.tcl
View file @
843a13e8
...
...
@@ -655,11 +655,11 @@ start_server {tags {"repl"}} {
puts
"master utime:
$master
_utime"
puts
"master stime:
$master
_stime"
}
if
{
$all
_drop ==
"all"
|| $all_drop ==
"slow"
}
{
if
{
!$::no_latency &&
(
$all
_drop ==
"all"
|| $all_drop ==
"slow"
)
}
{
assert
{
$master
_utime < 70
}
assert
{
$master
_stime < 70
}
}
if
{
$all
_drop ==
"none"
|| $all_drop ==
"fast"
}
{
if
{
!$::no_latency &&
(
$all
_drop ==
"none"
|| $all_drop ==
"fast"
)
}
{
assert
{
$master
_utime < 15
}
assert
{
$master
_stime < 15
}
}
...
...
tests/test_helper.tcl
View file @
843a13e8
...
...
@@ -88,6 +88,7 @@ set ::quiet 0
set ::denytags
{}
set ::skiptests
{}
set ::skipunits
{}
set ::no_latency 0
set ::allowtags
{}
set ::only_tests
{}
set ::single_tests
{}
...
...
@@ -540,6 +541,7 @@ proc print_help_screen {} {
"--skipfile <file> Name of a file containing test names that should be skipped (one per line)."
"--skiptest <name> Name of a file containing test names that should be skipped (one per line)."
"--dont-clean Don't delete redis log files after the run."
"--no-latency Skip latency measurements and validation by some tests."
"--stop Blocks once the first test fails."
"--loop Execute the specified set of tests forever."
"--wait-server Wait after server is started (so that you can attach a debugger)."
...
...
@@ -641,6 +643,8 @@ for {set j 0} {$j < [llength $argv]} {incr j} {
set ::durable 1
}
elseif
{
$opt
eq
{
--dont-clean
}}
{
set ::dont_clean 1
}
elseif
{
$opt
eq
{
--no-latency
}}
{
set ::no_latency 1
}
elseif
{
$opt
eq
{
--wait-server
}}
{
set ::wait_server 1
}
elseif
{
$opt
eq
{
--stop
}}
{
...
...
tests/unit/latency-monitor.tcl
View file @
843a13e8
...
...
@@ -17,7 +17,9 @@ start_server {tags {"latency-monitor"}} {
set max 450
foreach event
[
r latency history command
]
{
lassign $event time latency
assert
{
$latency
>= $min && $latency <= $max
}
if
{
!$::no_latency
}
{
assert
{
$latency
>= $min && $latency <= $max
}
}
incr min 100
incr max 100
set last_time $time
;
# Used in the next test
...
...
@@ -28,8 +30,10 @@ start_server {tags {"latency-monitor"}} {
foreach event
[
r latency latest
]
{
lassign $event eventname time latency max
assert
{
$eventname
eq
"command"
}
assert
{
$max
>= 450 & $max <= 650
}
assert
{
$time
== $last_time
}
if
{
!$::no_latency
}
{
assert
{
$max
>= 450 & $max <= 650
}
assert
{
$time
== $last_time
}
}
break
}
}
...
...
tests/unit/memefficiency.tcl
View file @
843a13e8
...
...
@@ -105,7 +105,9 @@ start_server {tags {"defrag"} overrides {appendonly yes auto-aof-rewrite-percent
assert
{
$frag
< 1.1
}
# due to high fragmentation, 100hz, and active-defrag-cycle-max set to 75,
# we expect max latency to be not much higher than 7.5ms but due to rare slowness threshold is set higher
assert
{
$max
_latency <= 30
}
if
{
!$::no_latency
}
{
assert
{
$max
_latency <= 30
}
}
}
# verify the data isn't corrupted or changed
set newdigest
[
r debug digest
]
...
...
@@ -148,7 +150,9 @@ start_server {tags {"defrag"} overrides {appendonly yes auto-aof-rewrite-percent
assert
{
$frag
< 1.4
}
# since the AOF contains simple
(
fast
)
SET commands
(
and the cron during loading runs every 1000 commands
)
,
# it'll still not block the loading for long periods of time.
assert
{
$max
_latency <= 30
}
if
{
!$::no_latency
}
{
assert
{
$max
_latency <= 30
}
}
}
}
r config set appendonly no
...
...
@@ -273,7 +277,9 @@ start_server {tags {"defrag"} overrides {appendonly yes auto-aof-rewrite-percent
assert
{
$frag
< 1.1
}
# due to high fragmentation, 100hz, and active-defrag-cycle-max set to 75,
# we expect max latency to be not much higher than 7.5ms but due to rare slowness threshold is set higher
assert
{
$max
_latency <= 30
}
if
{
!$::no_latency
}
{
assert
{
$max
_latency <= 30
}
}
}
# verify the data isn't corrupted or changed
set newdigest
[
r debug digest
]
...
...
@@ -368,7 +374,9 @@ start_server {tags {"defrag"} overrides {appendonly yes auto-aof-rewrite-percent
assert
{
$frag
< 1.1
}
# due to high fragmentation, 100hz, and active-defrag-cycle-max set to 75,
# we expect max latency to be not much higher than 7.5ms but due to rare slowness threshold is set higher
assert
{
$max
_latency <= 30
}
if
{
!$::no_latency
}
{
assert
{
$max
_latency <= 30
}
}
# in extreme cases of stagnation, we see over 20m misses before the tests aborts with
"defrag didn't stop"
,
# in normal cases we only see 100k misses out of 500k elements
...
...
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