4 # n - number of seconds to sleep
6 CONFIG_RU
=async_sinatra.ru
8 NeverBlock|EventMachine
) ;;
10 t_info
"skipping $T since it's not compatible with $model"
15 t_plan
7 "async_sinatra test for EM"
17 t_begin
"setup and start" && {
19 rtmpfiles a b c curl_err
21 # Async Sinatra does not support Rack::Lint
22 rainbows
-E none
-D $CONFIG_RU -c $unicorn_config
26 t_begin
"send async requests off in parallel" && {
28 ( curl
--no-buffer -sSf http
://$listen/$n 2>> $curl_err | utee
$a) &
29 ( curl
--no-buffer -sSf http
://$listen/$n 2>> $curl_err | utee
$b) &
30 ( curl
--no-buffer -sSf http
://$listen/$n 2>> $curl_err | utee
$c) &
33 t_begin
"ensure elapsed requests were processed in parallel" && {
36 elapsed
=$
(( $t1 - $t0 ))
37 echo "elapsed=$elapsed < 30"
41 t_begin
"termination signal sent" && {
51 t_begin
"no errors from curl" && {
55 t_begin
"no errors in stderr" && check_stderr
59 t_begin
"no responses are chunked" && {
60 test x
"$(cat $a)" = x
"delayed for $n seconds"
61 test x
"$(cat $b)" = x
"delayed for $n seconds"
62 test x
"$(cat $c)" = x
"delayed for $n seconds"