4 ThreadSpawn|ThreadPool|RevThreadSpawn|RevThreadPool
) ;;
5 *) t_info
"$0 is only compatible with Thread*"; exit 0 ;;
8 t_plan
6 "ThreadTimeout Rack middleware test for $model"
10 t_begin
"configure and start" && {
13 rainbows
-D t9100.ru
-c $unicorn_config
17 t_begin
"normal request should not timeout" && {
18 test x
"HI" = x
"$(curl -sSf http://$listen/ 2>> $curl_err)"
21 t_begin
"sleepy request times out with 408" && {
23 curl
-sSf http
://$listen/2 2>> $curl_err ||
> $ok
28 t_begin
"short requests do not timeout while making a long one" && {
31 curl
-sSf http
://$listen/2 2>$curl_err >/dev
/null
&
33 for i
in $
(awk </dev
/null
'BEGIN{for(i=20;--i>=0;)print i}')
35 curl
-sSf http
://$listen/0.1 >> $ok 2>&1 &
36 test x
"HI" = x
"$(curl -sSf http://$listen/0.05)"
40 test x
"HI" = x
"$(curl -sSf http://$listen/)"
43 test 20 -eq $
(grep '^HI$' $ok |
wc -l)
44 test x
= x
"$(grep -v '^HI$' $ok)"
48 t_begin
"kill server" && {
52 t_begin
"no errors in Rainbows! stderr" && {