X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/1043c8064bce1ffaaa89c9358889bf0ea0b33f51..021d16b6430b39f7709a70466007df1ca16867e5:/tests/support/server.tcl?ds=inline diff --git a/tests/support/server.tcl b/tests/support/server.tcl index 984270ad..2c2665b6 100644 --- a/tests/support/server.tcl +++ b/tests/support/server.tcl @@ -46,11 +46,16 @@ proc kill_server config { } # kill server and wait for the process to be totally exited + catch {exec kill $pid} while {[is_alive $config]} { - if {[incr wait 10] % 1000 == 0} { + incr wait 10 + + if {$wait >= 5000} { + puts "Forcing process $pid to exit..." + catch {exec kill -KILL $pid} + } elseif {$wait % 1000 == 0} { puts "Waiting for process $pid to exit..." } - catch {exec kill $pid} after 10 } @@ -102,7 +107,7 @@ proc tags {tags code} { } proc start_server {options {code undefined}} { - # If we are runnign against an external server, we just push the + # If we are running against an external server, we just push the # host/port pair in the stack the first time if {$::external} { if {[llength $::servers] == 0} { @@ -247,7 +252,7 @@ proc start_server {options {code undefined}} { while 1 { # check that the server actually started and is ready for connections - if {[exec cat $stdout | grep "ready to accept" | wc -l] > 0} { + if {[exec grep "ready to accept" | wc -l < $stdout] > 0} { break } after 10