4 ThreadSpawn|ThreadPool
) ;;
5 RevThreadSpawn|RevThreadPool
) ;;
6 CoolioThreadSpawn|CoolioThreadPool
) ;;
7 *) t_info
"$0 is only compatible with Thread*"; exit 0 ;;
10 t_plan
6 "ThreadTimeout Rack middleware test for $model"
12 t_begin
"configure and start" && {
13 rtmpfiles curl_err curl_out
14 rainbows_setup
$model 10
15 rainbows
-D t9101.ru
-c $unicorn_config
19 t_begin
"normal request should not timeout" && {
20 test x
"HI" = x
"$(curl -sSf http://$listen/ 2>> $curl_err)"
23 t_begin
"8 sleepy requests do not time out" && {
25 for i
in 1 2 3 4 5 6 7 8
27 curl
--no-buffer -sSf http
://$listen/3 \
28 2>> $curl_err >> $curl_out &
31 test 8 -eq "$(wc -l < $curl_out)"
32 test xHI
= x
"$(sort < $curl_out | uniq)"
35 t_begin
"9 sleepy requests, some time out" && {
38 for i
in 1 2 3 4 5 6 7 8 9
40 curl
-sSf --no-buffer \
41 http
://$listen/3 2>> $curl_err >> $curl_out &
47 t_begin
"kill server" && {
51 t_begin
"no errors in Rainbows! stderr" && {