Add -N or --no-default-middleware option.
[rainbows.git] / t / t9101-thread-timeout-threshold.sh
blob07ac3b23452802d8b01b958aff6980303429bce1
1 #!/bin/sh
2 . ./test-lib.sh
3 check_threaded_app_dispatch
5 t_plan 6 "ThreadTimeout Rack middleware test for $model"
7 t_begin "configure and start" && {
8 rtmpfiles curl_err curl_out
9 rainbows_setup $model 10
10 rainbows -D t9101.ru -c $unicorn_config
11 rainbows_wait_start
14 t_begin "normal request should not timeout" && {
15 test x"HI" = x"$(curl -sSf http://$listen/ 2>> $curl_err)"
18 t_begin "8 sleepy requests do not time out" && {
19 > $curl_err
20 for i in 1 2 3 4 5 6 7 8
22 curl --no-buffer -sSf http://$listen/3 \
23 2>> $curl_err >> $curl_out &
24 done
25 wait
26 test 8 -eq "$(wc -l < $curl_out)"
27 test xHI = x"$(sort < $curl_out | uniq)"
30 t_begin "9 sleepy requests, some time out" && {
31 > $curl_err
32 > $curl_out
33 for i in 1 2 3 4 5 6 7 8 9
35 curl -sSf --no-buffer \
36 http://$listen/3 2>> $curl_err >> $curl_out &
37 done
38 wait
39 grep 408 $curl_err
42 t_begin "kill server" && {
43 kill $rainbows_pid
46 t_begin "no errors in Rainbows! stderr" && {
47 check_stderr
50 t_done