diff --git a/tests/support/server.tcl b/tests/support/server.tcl index c36b3077..5578f1fd 100644 --- a/tests/support/server.tcl +++ b/tests/support/server.tcl @@ -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} { diff --git a/tests/test_helper.tcl b/tests/test_helper.tcl index 8b4d1eac..8c6a3b81 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 Number of test clients (default 16)." "--timeout 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