X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/74f10793c8b53fac97b44c3bf8d04cdf2d157bd7..0bd6d68e34bc41cd80cd7fc44aab9cf3884de8dc:/tests/support/server.tcl?ds=sidebyside diff --git a/tests/support/server.tcl b/tests/support/server.tcl index 928e5c40..35c1cb87 100644 --- a/tests/support/server.tcl +++ b/tests/support/server.tcl @@ -17,7 +17,7 @@ proc check_valgrind_errors stderr { set buf [read $fd] close $fd - if {![regexp -- {ERROR SUMMARY: 0 errors} $buf] || + if {[regexp -- { at 0x} $buf] || (![regexp -- {definitely lost: 0 bytes} $buf] && ![regexp -- {no leaks are possible} $buf])} { send_data_packet $::test_server_fd err "Valgrind error: $buf\n" @@ -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 } @@ -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