summaryrefslogtreecommitdiff
path: root/tests/test_helper.tcl
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2011-07-11 00:46:25 +0200
committerantirez <antirez@gmail.com>2011-07-11 00:46:25 +0200
commit569f84aa7cda1d47a27738906b1707741151521d (patch)
treeab38fde39ec39bcebb76586cf24c9e20c339f304 /tests/test_helper.tcl
parent82e5dd35ea99692cc10077be95485242a9b352a3 (diff)
downloadredis-569f84aa7cda1d47a27738906b1707741151521d.tar.gz
replication test split into three parts in order to improve test execution time. Random fixes and improvements.
Diffstat (limited to 'tests/test_helper.tcl')
-rw-r--r--tests/test_helper.tcl16
1 files changed, 13 insertions, 3 deletions
diff --git a/tests/test_helper.tcl b/tests/test_helper.tcl
index 2bb18bc9e..f96b68c61 100644
--- a/tests/test_helper.tcl
+++ b/tests/test_helper.tcl
@@ -24,6 +24,8 @@ set ::all_tests {
unit/cas
unit/quit
integration/replication
+ integration/replication-2
+ integration/replication-3
integration/aof
unit/pubsub
unit/slowlog
@@ -166,9 +168,11 @@ proc test_server_main {} {
}
# Start the client instances
+ set ::clients_pids {}
for {set j 0} {$j < $::numclients} {incr j} {
- exec tclsh8.5 [info script] {*}$::argv \
- --client $port --port [expr {$::port+($j*10)}] &
+ set p [exec tclsh8.5 [info script] {*}$::argv \
+ --client $port --port [expr {$::port+($j*10)}] &]
+ lappend ::clients_pids $p
}
# Setup global state for the test server
@@ -215,13 +219,19 @@ proc read_from_test_client fd {
} elseif {$status eq {done}} {
set elapsed [expr {[clock seconds]-$::clients_start_time($fd)}]
puts "\[[colorstr yellow $status]\]: $data ($elapsed seconds)"
- puts "+++ [llength $::active_clients] units still in execution."
+ puts "+++ [expr {[llength $::active_clients]-1}] units still in execution."
lappend ::clients_time_history $elapsed $data
signal_idle_client $fd
} elseif {$status eq {ok}} {
puts "\[[colorstr green $status]\]: $data"
} elseif {$status eq {err}} {
puts "\[[colorstr red $status]\]: $data"
+ } elseif {$status eq {exception}} {
+ puts "\[[colorstr red $status]\]: $data"
+ foreach p $::clients_pids {
+ catch {exec kill -9 $p}
+ }
+ exit 1
} else {
puts "\[$status\]: $data"
}