event_machine: avoid redundant open() for static files
[rainbows.git] / t / t0600-rack-fiber_pool.sh
blob01f28b5ef7148d47bf6ba8dfbf812294480cba7b
1 #!/bin/sh
2 . ./test-lib.sh
3 case $model in
4 EventMachine) ;;
5 *)
6 t_info "skipping $T since it's not compatible with $model"
7 exit 0
8 ;;
9 esac
11 require_check rack/fiber_pool Rack::FiberPool
13 t_plan 7 "basic test with rack-fiber_pool gem"
15 CONFIG_RU=rack-fiber_pool/app.ru
17 t_begin "setup and start" && {
18 rainbows_setup
19 rtmpfiles curl_err curl_out
21 rainbows -D -c $unicorn_config $CONFIG_RU
22 rainbows_wait_start
25 t_begin "send requests off in parallel" && {
26 curl --no-buffer -sSf http://$listen/ >> $curl_out 2>> $curl_err &
27 curl --no-buffer -sSf http://$listen/ >> $curl_out 2>> $curl_err &
28 curl --no-buffer -sSf http://$listen/ >> $curl_out 2>> $curl_err &
31 t_begin "wait for curl terminations" && {
32 wait
35 t_begin "termination signal sent" && {
36 kill $rainbows_pid
39 t_begin "no errors from curl" && {
40 test ! -s $curl_err
43 t_begin "no errors in stderr" && check_stderr
45 t_begin "ensure we hit 3 separate fibers" && {
46 test x3 = x"$(sort < $curl_out | uniq | wc -l)"
49 t_done