3 skip_models StreamResponseEpoll
4 t_plan
6 "keepalive_requests limit tests for $model"
6 t_begin
"setup and start" && {
7 rainbows_setup
$model 50 666
8 rtmpfiles curl_out curl_err
9 grep 'keepalive_timeout 666' $unicorn_config
10 rainbows
-E none
-D env.ru
-c $unicorn_config
14 t_begin
"curl requests hit default keepalive_requests limit" && {
15 curl
-sSfv http
://$listen/[0-101] > $curl_out 2> $curl_err
16 test 1 -eq $
(grep 'Connection: close' $curl_err |count_lines
)
17 test 101 -eq $
(grep 'Connection: keep-alive' $curl_err |count_lines
)
20 t_begin
"reload with smaller keepalive_requests limit" && {
21 ed
-s $unicorn_config <<EOF
28 kill -HUP $rainbows_pid
29 test x
"$(cat $fifo)" = xSTART
32 t_begin
"curl requests hit smaller keepalive_requests limit" && {
33 rm -f $curl_out $curl_err
34 curl
-sSfv http
://$listen/[1-13] > $curl_out 2> $curl_err
35 test 2 -eq $
(grep 'Connection: close' $curl_err |count_lines
)
36 test 11 -eq $
(grep 'Connection: keep-alive' $curl_err |count_lines
)
39 t_begin
"killing succeeds" && {
43 t_begin
"check stderr" && {