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