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