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" && {
16 rainbows
-D t9100.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
"sleepy request times out with 408" && {
26 curl
-sSf http
://$listen/2 2>> $curl_err ||
> $ok
31 t_begin
"short requests do not timeout while making a long one" && {
34 curl
-sSf http
://$listen/2 2>$curl_err >/dev
/null
&
36 for i
in $
(awk </dev
/null
'BEGIN{for(i=20;--i>=0;)print i}')
38 curl
-sSf http
://$listen/0.1 >> $ok 2>&1 &
39 test x
"HI" = x
"$(curl -sSf http://$listen/0.05)"
43 test x
"HI" = x
"$(curl -sSf http://$listen/)"
46 test 20 -eq $
(grep '^HI$' $ok |
wc -l)
47 test x
= x
"$(grep -v '^HI$' $ok)"
51 t_begin
"kill server" && {
55 t_begin
"no errors in Rainbows! stderr" && {