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
3d56311f
Commit
3d56311f
authored
Aug 02, 2018
by
antirez
Browse files
Test suite: add --loop option.
Very useful with --stop in order to catch heisenbugs.
parent
26897c03
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/test_helper.tcl
View file @
3d56311f
...
@@ -90,6 +90,7 @@ set ::active_servers {} ; # Pids of active Redis instances.
...
@@ -90,6 +90,7 @@ set ::active_servers {} ; # Pids of active Redis instances.
set ::dont_clean 0
set ::dont_clean 0
set ::wait_server 0
set ::wait_server 0
set ::stop_on_failure 0
set ::stop_on_failure 0
set ::loop 0
# Set to 1 when we are running in client mode. The Redis test uses a
# Set to 1 when we are running in client mode. The Redis test uses a
# server-client model to run tests simultaneously. The server instance
# server-client model to run tests simultaneously. The server instance
...
@@ -370,6 +371,9 @@ proc signal_idle_client fd {
...
@@ -370,6 +371,9 @@ proc signal_idle_client fd {
send_data_packet $fd run
[
lindex $::all_tests $::next_test
]
send_data_packet $fd run
[
lindex $::all_tests $::next_test
]
lappend ::active_clients $fd
lappend ::active_clients $fd
incr ::next_test
incr ::next_test
if
{
$::loop
&& $::next_test ==
[
llength $::all_tests
]}
{
set ::next_test 0
}
}
else
{
}
else
{
lappend ::idle_clients $fd
lappend ::idle_clients $fd
if
{[
llength $::active_clients
]
== 0
}
{
if
{[
llength $::active_clients
]
== 0
}
{
...
@@ -439,11 +443,12 @@ proc print_help_screen {} {
...
@@ -439,11 +443,12 @@ proc print_help_screen {} {
"--clients <num> Number of test clients (default 16)."
"--clients <num> Number of test clients (default 16)."
"--timeout <sec> Test timeout in seconds (default 10 min)."
"--timeout <sec> Test timeout in seconds (default 10 min)."
"--force-failure Force the execution of a test that always fails."
"--force-failure Force the execution of a test that always fails."
"--config <k> <v> Extra config file argument"
"--config <k> <v> Extra config file argument."
"--skipfile <file> Name of a file containing test names that should be skipped (one per line)"
"--skipfile <file> 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"
"--dont-clean Don't delete redis log files after the run."
"--stop Blocks once the first test fails"
"--stop Blocks once the first test fails."
"--wait-server Wait after server is started (so that you can attach a debugger)"
"--loop Execute the specified set of tests forever."
"--wait-server Wait after server is started (so that you can attach a debugger)."
"--help Print this help screen."
"--help Print this help screen."
}
"
\n
"
]
}
"
\n
"
]
}
}
...
@@ -520,6 +525,8 @@ for {set j 0} {$j < [llength $argv]} {incr j} {
...
@@ -520,6 +525,8 @@ for {set j 0} {$j < [llength $argv]} {incr j} {
set ::wait_server 1
set ::wait_server 1
}
elseif
{
$opt
eq
{
--stop
}}
{
}
elseif
{
$opt
eq
{
--stop
}}
{
set ::stop_on_failure 1
set ::stop_on_failure 1
}
elseif
{
$opt
eq
{
--loop
}}
{
set ::loop 1
}
elseif
{
$opt
eq
{
--timeout
}}
{
}
elseif
{
$opt
eq
{
--timeout
}}
{
set ::timeout $arg
set ::timeout $arg
incr j
incr j
...
...
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