]> git.saurik.com Git - redis.git/blobdiff - tests/support/server.tcl
in kill_server send the signal once, then wait for up to 5sec before sending lethal...
[redis.git] / tests / support / server.tcl
index 984270adb1b47e803d4e44825b3114df08423792..b1ab38fc1089afcfae386c14d16f5ff041fecc3f 100644 (file)
@@ -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
     }