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
345b4809
Unverified
Commit
345b4809
authored
Jun 27, 2018
by
Salvatore Sanfilippo
Committed by
GitHub
Jun 27, 2018
Browse files
Merge pull request #5063 from oranagra/test_suite_improvements
test suite infra improvements and fix
parents
35c5f3fa
751eea24
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/support/server.tcl
View file @
345b4809
...
...
@@ -276,6 +276,12 @@ proc start_server {options {code undefined}} {
error_and_quit $config_file $line
}
if
{
$::wait
_server
}
{
set msg
"server started PID:
[
dict get $srv
"pid"
]
. press any key to continue..."
puts $msg
read stdin 1
}
while 1
{
# check that the server actually started and is ready for connections
if
{[
exec grep -i
"Ready to accept"
| wc -l < $stdout
]
> 0
}
{
...
...
tests/test_helper.tcl
View file @
345b4809
...
...
@@ -82,6 +82,8 @@ set ::force_failure 0
set ::timeout 600
;
# 10 minutes without progresses will quit the test.
set ::last_progress
[
clock seconds
]
set ::active_servers
{}
;
# Pids of active Redis instances.
set ::dont_clean 0
set ::wait_server 0
# 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
...
...
@@ -175,6 +177,9 @@ proc s {args} {
}
proc cleanup
{}
{
if
{
$::dont
_clean
}
{
return
}
if
{
!$::quiet
}
{
puts -nonewline
"Cleanup: may take some time... "
}
flush stdout
catch
{
exec rm -rf
{*}
[
glob tests/tmp/redis.conf.*
]}
...
...
@@ -224,6 +229,7 @@ proc test_server_cron {} {
if
{
$elapsed
> $::timeout
}
{
set err
"
\[
[
colorstr red TIMEOUT
]
\]
: clients state report follows."
puts $err
lappend ::failed_tests $err
show_clients_state
kill_clients
force_kill_all_servers
...
...
@@ -410,6 +416,8 @@ proc print_help_screen {} {
"--clients <num> Number of test clients (default 16)."
"--timeout <sec> Test timeout in seconds (default 10 min)."
"--force-failure Force the execution of a test that always fails."
"--dont-clean don't delete redis log files after the run"
"--wait-server wait after server is started (so that you can attach a debugger)"
"--help Print this help screen."
}
"
\n
"
]
}
...
...
@@ -463,6 +471,11 @@ for {set j 0} {$j < [llength $argv]} {incr j} {
}
elseif
{
$opt
eq
{
--clients
}}
{
set ::numclients $arg
incr j
}
elseif
{
$opt
eq
{
--dont-clean
}}
{
set ::dont_clean 1
}
elseif
{
$opt
eq
{
--wait-server
}}
{
set ::wait_server 1
incr j
}
elseif
{
$opt
eq
{
--timeout
}}
{
set ::timeout $arg
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