6 config_ru
=$
(mktemp
-t rainbows.$$.XXXXXXXX.config.ru
)
7 unicorn_config
=$
(mktemp
-t rainbows.$$.XXXXXXXX.unicorn.rb
)
8 curl_out
=$
(mktemp
-t rainbows.$$.XXXXXXXX.curl.out
)
9 curl_err
=$
(mktemp
-t rainbows.$$.XXXXXXXX.curl.err
)
10 pid
=$
(mktemp
-t rainbows.$$.XXXXXXXX.pid
)
11 TEST_RM_LIST
="$TEST_RM_LIST $config_ru $unicorn_config $lock_path"
12 TEST_RM_LIST
="$TEST_RM_LIST $curl_out $curl_err"
14 cat > $config_ru <<\EOF
15 use Rack
::ContentLength
19 [ 200, {}, [ Thread.current.inspect
<< "\n" ] ]
26 cat > $unicorn_config <<EOF
31 worker_connections $nr_actor
35 rainbows
-D $config_ru -c $unicorn_config
39 for i
in $
(awk "BEGIN{for(i=0;i<$nr_client;++i) print i}" </dev
/null
)
41 ( curl
-sSf http
://$listen/$i >> $curl_out 2>> $curl_err ) &
44 echo elapsed
=$
(( $
(date +%s
) - $start ))
49 test x
"$(wc -l < $curl_out)" = x
$nr_client
50 nr
=$
(sort < $curl_out |
uniq |
wc -l)