4 t_plan
29 "keepalive does not clear Rack env prematurely for $model"
6 t_begin
"setup and start" && {
8 rtmpfiles curl_out curl_err
9 echo "preload_app true" >> $unicorn_config
10 rainbows
-D close-has-env.ru
-c $unicorn_config
16 t_begin
"make pipelined requests to trigger $pfx response body" && {
20 printf 'GET /%s/1 HTTP/1.1\r\n' $pfx
21 printf 'Host: example.com\r\n\r\n'
22 printf 'GET /%s/2 HTTP/1.1\r\n' $pfx
23 printf 'Host: example.com\r\n\r\n'
24 printf 'GET /%s/3 HTTP/1.1\r\n' $pfx
25 printf 'Host: example.com\r\n'
26 printf 'Connection: close\r\n\r\n'
29 ) | socat
- TCP4
:$listen > $fifo
30 test xok
= x$
(cat $ok)
35 t_begin
'reloading Rainbows! to ensure writeout' && {
36 # ensure worker is loaded before HUP
37 curl
-s http
://$listen/ >/dev
/null
38 # reload to ensure everything is flushed
39 kill -HUP $rainbows_pid
40 test xSTART
= x
"$(cat $fifo)"
46 t_begin
"check body close messages" && {
48 /^path_info=\/'$pfx'\/[1-3]$/ { next }
50 END { exit(NR == 3 ? 0 : 1) }
57 t_begin
"make keepalive requests to trigger $pfx response body" && {
59 rm -f $curl_err $curl_out
60 curl
-vsSf http
://$listen/$pfx/[1-3] 2> $curl_err > $curl_out
88 t_begin
"enable sendfile gem" && {
89 echo "require 'sendfile'" >> $unicorn_config
102 t_begin
"killing succeeds" && {
106 t_begin
"check stderr" && {