summaryrefslogtreecommitdiff
path: root/tests/test_helper.tcl
diff options
context:
space:
mode:
authorOran Agra <oran@redislabs.com>2018-06-26 14:14:04 +0300
committerOran Agra <oran@redislabs.com>2018-06-26 20:23:55 +0300
commit751eea24c44a762f0e5d04477defa27e26f2d9d9 (patch)
tree69917e585025bfdabf3259dd2195c2a008134219 /tests/test_helper.tcl
parentbb666d445d83287295832699d0b86d61866fedef (diff)
downloadredis-751eea24c44a762f0e5d04477defa27e26f2d9d9.tar.gz
test suite infra improvements and fix
* fail the test (exit code) in case of timeout. * add --wait-server to allow attaching a debugger * add --dont-clean to keep log files when tests are done
Diffstat (limited to 'tests/test_helper.tcl')
-rw-r--r--tests/test_helper.tcl13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_helper.tcl b/tests/test_helper.tcl
index 8b4d1eacf..8c6a3b814 100644
--- a/tests/test_helper.tcl
+++ b/tests/test_helper.tcl
@@ -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