projects
/
redis.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1488645
)
wait for redis-server to be settled and ready for connections
author
Pieter Noordhuis
<pcnoordhuis@gmail.com>
Fri, 14 May 2010 16:08:53 +0000
(18:08 +0200)
committer
Pieter Noordhuis
<pcnoordhuis@gmail.com>
Fri, 14 May 2010 16:08:53 +0000
(18:08 +0200)
test/support/server.tcl
patch
|
blob
|
blame
|
history
diff --git
a/test/support/server.tcl
b/test/support/server.tcl
index 53ca468308c64a5d8724f170253528bfb012eadf..7f95c4a9c0bfe5ffc570a991862a80abca76e85c 100644
(file)
--- a/
test/support/server.tcl
+++ b/
test/support/server.tcl
@@
-22,9
+22,9
@@
proc kill_server config {
# kill server and wait for the process to be totally exited
exec kill $pid
while 1 {
# kill server and wait for the process to be totally exited
exec kill $pid
while 1 {
+ # with a non-zero exit status, the process is gone
if {[catch {exec ps -p $pid | grep redis-server} result]} {
if {[catch {exec ps -p $pid | grep redis-server} result]} {
- # non-zero exis status, process is gone
- break;
+ break
}
after 10
}
}
after 10
}
@@
-79,6
+79,14
@@
proc start_server {filename overrides {code undefined}} {
error_and_quit $config_file $line
}
error_and_quit $config_file $line
}
+ while 1 {
+ # check that the server actually started and is ready for connections
+ if {[exec cat $stdout | grep "ready to accept" | wc -l] > 0} {
+ break
+ }
+ after 10
+ }
+
# find out the pid
regexp {^\[(\d+)\]} [exec head -n1 $stdout] _ pid
# find out the pid
regexp {^\[(\d+)\]} [exec head -n1 $stdout] _ pid