stream_response_epoll: our most "special" concurrency option yet
[rainbows.git] / t / t0040-keepalive_requests-setting.sh
blob103b217b1705bbf3651a3febffcd832d67723d07
1 #!/bin/sh
2 . ./test-lib.sh
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
11 rainbows_wait_start
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 |wc -l)
17 test 101 -eq $(grep 'Connection: keep-alive' $curl_err |wc -l)
20 t_begin "reload with smaller keepalive_requests limit" && {
21 ed -s $unicorn_config <<EOF
22 ,g/Rainbows!/
24 keepalive_requests 5
27 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 |wc -l)
36 test 11 -eq $(grep 'Connection: keep-alive' $curl_err |wc -l)
39 t_begin "killing succeeds" && {
40 kill $rainbows_pid
43 t_begin "check stderr" && {
44 check_stderr
47 t_done