From ccd4681cdd361f00b86d29e9d1b1ccae0e7d5079 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 24 Oct 2009 10:23:11 -0700 Subject: tests: avoid race condition in reopen logs test Ensure our workers are capable of processing requests before we can continue to setup signal handlers. The later "kill -USR1" signal may fire in our test script before the workers have a chance to setup the handlers. So by the time we receive a positive response, we _know_ signal handlers are ready. --- t/lib-reopen-logs.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/t/lib-reopen-logs.sh b/t/lib-reopen-logs.sh index 813f204..352a789 100644 --- a/t/lib-reopen-logs.sh +++ b/t/lib-reopen-logs.sh @@ -18,6 +18,9 @@ EOF rainbows -D sleep.ru -c $unicorn_config wait_for_pid $pid +# ensure our server is started and responding before signaling +curl -sSf http://$listen/ >/dev/null + start=$(date +%s) for i in $(awk "BEGIN{for(i=0;i<$nr_client;++i) print i}"