2 if test -z "$V" ||
test 0 -eq "$V"
7 skip_models WriterThreadSpawn WriterThreadPool Base
8 t_plan
6 "keepalive_timeout CPU usage tests for $model"
10 t_begin
"setup and start" && {
11 rainbows_setup
$model 50 666
12 grep 'worker_connections 50' $unicorn_config
13 grep 'keepalive_timeout 666' $unicorn_config
14 rainbows
-E deployment
-D times.ru
-c $unicorn_config
18 t_begin
'read current times' && {
19 eval "$(curl -sSf http://$listen/)"
22 echo "utime=$utime stime=$stime"
25 t_begin
'keepalive connections' && {
26 listen
=$listen $RUBY -rsocket -e '
27 host, port = ENV["listen"].split(/:/)
29 socks = (1..49).map do |i|
30 s = TCPSocket.new(host, port)
31 # need to write something to get around deferred accepts
32 s.write "GET /#{i} HTTP/1.1\r\nHost: example.com\r\n\r\n"
39 for i
in $
(awk 'BEGIN { for(i=0;i<60;++i) print i }' </dev
/null
)
42 eval "$(curl -sSf http://$listen/)"
43 echo "utime[$i] $before_utime => $utime" \
44 "stime[$i] $before_stime => $stime"
49 t_begin
"times not unreasonable" && {
50 echo "utime: $before_utime => $utime" \
51 "stime: $before_stime => $stime"
54 t_begin
"killing succeeds" && {
58 t_begin
"check stderr" && {