]> git.saurik.com Git - redis.git/commitdiff
Merge pull request #430 from anydot/f-testsuite
authorSalvatore Sanfilippo <antirez@gmail.com>
Thu, 5 Apr 2012 08:56:12 +0000 (01:56 -0700)
committerSalvatore Sanfilippo <antirez@gmail.com>
Thu, 5 Apr 2012 08:56:12 +0000 (01:56 -0700)
Two changes of testsuite (killing redis and new option)

tests/support/server.tcl
tests/test_helper.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
     }
 
index 34d96606d134eb077f3802f9548cded17e97a430..2ec3aad1c16c4bf7679af16fe45bbbdf4331ee12 100644 (file)
@@ -345,6 +345,7 @@ proc print_help_screen {} {
         "--quiet            Don't show individual tests."
         "--single <unit>    Just execute the specified unit (see next option)."
         "--list-tests       List all the available test units."
+        "--clients <num>    Number of test clients (16)."
         "--force-failure    Force the execution of a test that always fails."
         "--help             Print this help screen."
     } "\n"]
@@ -390,6 +391,9 @@ for {set j 0} {$j < [llength $argv]} {incr j} {
         set ::client 1
         set ::test_server_port $arg
         incr j
+    } elseif {$opt eq {--clients}} {
+        set ::numclients $arg
+        incr j
     } elseif {$opt eq {--help}} {
         print_help_screen
         exit 0