2 test -r random_blob || die
"random_blob required, run with 'make $0'"
3 if ! grep -v ^VmRSS
: /proc
/self
/status
>/dev
/null
2>&1
5 echo >&2 "skipping, can't read RSS from /proc/self/status"
8 echo "large file response slurp avoidance for model=$model"
10 rtmpfiles unicorn_config tmp r_err r_out pid ok
12 cat > $unicorn_config <<EOF
17 Rainbows! { use :$model }
20 # can't load Rack::Lint here since it'll cause Rev to slurp
21 rainbows
-E none
-D large-file-response.ru
-c $unicorn_config
24 random_blob_size
=$
(wc -c < random_blob
)
25 curl
-v http
://$listen/rss
27 rss_before
=$
(curl
-sSfv http
://$listen/rss
)
28 echo "rss_before=$rss_before"
32 size
=$
( (curl
-sSfv http
://$listen/random_blob
&& echo ok
> $ok) |
wc -c)
33 test $size -eq $random_blob_size
34 test xok
= x$
(cat $ok)
38 curl
-v http
://$listen/rss
39 rss_after
=$
(curl
-sSfv http
://$listen/rss
)
40 echo "rss_after=$rss_after"
41 diff=$
(( $rss_after - $rss_before ))
42 echo "test diff=$diff < orig=$random_blob_size"
43 kill -QUIT $
(cat $pid)
44 test $diff -le $random_blob_size