5 NeverBlock|EventMachine
) ;;
7 t_info
"skipping $T since it's not compatible with $model"
12 t_plan
8 "async_tailer test for test for EM"
14 CONFIG_RU
=async_examples
/async_tailer.ru
16 t_begin
"setup and start" && {
18 rtmpfiles a b c curl_err TAIL_LOG_FILE expect
20 printf '<h1>Async Tailer</h1><pre>' >> $expect
24 # this does not does not support Rack::Lint
25 rainbows
-E deployment
-D $CONFIG_RU -c $unicorn_config
29 t_begin
"send async requests off in parallel" && {
31 curl
--no-buffer -sSf http
://$listen/ > $a 2>> $curl_err &
33 curl
--no-buffer -sSf http
://$listen/ > $b 2>> $curl_err &
35 curl
--no-buffer -sSf http
://$listen/ > $c 2>> $curl_err &
39 t_begin
"generate log output" && {
40 for i
in $
(awk "BEGIN {for(i=0;i<$nr;i++) print i}" < /dev
/null
)
42 date >> $TAIL_LOG_FILE
45 # sometimes tail(1) can be slow
49 t_begin
"kill curls and wait for termination" && {
50 kill $curl_a $curl_b $curl_c
53 elapsed
=$
(( $t1 - $t0 ))
54 t_info
"elapsed=$elapsed"
57 t_begin
"termination signal sent" && {
58 kill -QUIT $rainbows_pid
61 t_begin
"no errors from curl" && {
65 t_begin
"no errors in stderr" && check_stderr
67 t_begin
"responses match expected" && {
68 cat $TAIL_LOG_FILE >> $expect