3 check_threaded_app_dispatch
5 t_plan
6 "ThreadTimeout Rack middleware test for $model"
7 t_begin
"configure and start" && {
8 rtmpfiles curl_err curl_out
9 rainbows_setup
$model 10
10 rainbows
-D t9101.ru
-c $unicorn_config
14 t_begin
"normal request should not timeout" && {
15 test x
"HI" = x
"$(curl -sSf http://$listen/ 2>> $curl_err)"
18 t_begin
"8 sleepy requests do not time out" && {
20 for i
in 1 2 3 4 5 6 7 8
22 curl
--no-buffer -sSf http
://$listen/3 \
23 2>> $curl_err >> $curl_out &
26 test 8 -eq "$(count_lines < $curl_out)"
27 test xHI
= x
"$(sort < $curl_out | uniq)"
30 t_begin
"9 sleepy requests, some time out" && {
33 for i
in 1 2 3 4 5 6 7 8 9
35 curl
-sSf --no-buffer \
36 http
://$listen/3 2>> $curl_err >> $curl_out &
42 t_begin
"kill server" && {
46 t_begin
"no errors in Rainbows! stderr" && {