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" && {
15 rainbows
-D t9100.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
"sleepy request times out with 408" && {
25 curl
-sSf http
://$listen/2 2>> $curl_err ||
> $ok
30 t_begin
"short requests do not timeout while making a long one" && {
33 curl
-sSf http
://$listen/2 2>$curl_err >/dev
/null
&
35 for i
in $
(awk </dev
/null
'BEGIN{for(i=20;--i>=0;)print i}')
37 curl
-sSf http
://$listen/0.1 >> $ok 2>&1 &
38 test x
"HI" = x
"$(curl -sSf http://$listen/0.05)"
42 test x
"HI" = x
"$(curl -sSf http://$listen/)"
45 test 20 -eq $
(grep '^HI$' $ok |
wc -l)
46 test x
= x
"$(grep -v '^HI$' $ok)"
50 t_begin
"kill server" && {
54 t_begin
"no errors in Rainbows! stderr" && {