coolio+xepoll_thread*: use shutdown() for keepalive timeout
[rainbows.git] / t / t9000-rack-app-pool.sh
blobecb8aeb23f6208651079d2ba6b7bd2c4be3c7c70
1 #!/bin/sh
2 . ./test-lib.sh
3 case $model in
4 *CoolioThread*|*RevThread*|Thread*|*Fiber*|Revactor|NeverBlock) ;;
5 *)
6 t_info "skipping $T since it's not compatible with $model"
7 exit 0
8 ;;
9 esac
10 nr_client=30 APP_POOL_SIZE=4
12 t_plan 6 "AppPool Rack middleware test for $model"
14 t_begin "configure and start" && {
15 rtmpfiles curl_out curl_err
16 rainbows_setup $model 50
17 APP_POOL_SIZE=$APP_POOL_SIZE rainbows -D t9000.ru -c $unicorn_config
18 rainbows_wait_start
21 t_begin "launch $nr_client requests" && {
22 start=$(date +%s)
23 seq="$(awk "BEGIN{for(i=0;i<$nr_client;++i) print i}" </dev/null)"
24 for i in $seq
26 curl -sSf http://$listen/ >> $curl_out 2>> $curl_err &
27 done
28 wait
29 t_info elapsed=$(( $(date +%s) - $start ))
32 t_begin "kill server" && {
33 kill $rainbows_pid
36 t_begin "$APP_POOL_SIZE instances of app were used" && {
37 test $APP_POOL_SIZE -eq $(sort < $curl_out | uniq | wc -l)
40 t_begin "no errors in curl stderr" && {
41 test ! -s $curl_err
44 t_begin "no errors in Rainbows! stderr" && {
45 check_stderr
48 t_done