6 t_info
"skipping $T since it's not compatible with $model"
10 RUBYLIB
=$
($RUBY test_isolate_cramp.rb
):$RUBYLIB
12 require_check cramp Cramp
::VERSION
14 t_plan
7 "streaming test for Cramp"
16 CONFIG_RU
=cramp
/streaming.ru
18 t_begin
"setup and start" && {
20 rtmpfiles a b c curl_err expect
22 # requiring Rubygems for this test only since Cramp depends on
23 # pre versions of several gems
24 # Like the rest of the EM/async stuff, it's not Rack::Lint compatible
25 rainbows
-E deployment
-D $CONFIG_RU -c $unicorn_config
29 # this will spew any unexpected input to stdout and be silent on success
33 while read hello world
37 t_info
"i=$i diff=$diff hello=$hello world=$world"
38 test $diff -ge 1 ||
echo "$i: diff: $diff < 1 second"
40 test xHello
= x
"$hello" ||
echo "$i: Hello != $hello"
41 test xWorld
= x
"$world" ||
echo "$i: World != $world"
43 test $i -le 3 ||
echo "$i: $i > 3"
48 t_begin
"send async requests off in parallel" && {
50 curl
--no-buffer -sSf http
://$listen/ 2>> $curl_err | check
>$a 2>&1 &
51 curl
--no-buffer -sSf http
://$listen/ 2>> $curl_err | check
>$b 2>&1 &
52 curl
--no-buffer -sSf http
://$listen/ 2>> $curl_err | check
>$c 2>&1 &
55 t_begin
"wait for curl terminations" && {
58 elapsed
=$
(( $t1 - $t0 ))
59 t_info
"elapsed=$elapsed (should be 4-5s)"
62 t_begin
"termination signal sent" && {
66 t_begin
"no errors from curl" && {
70 t_begin
"no errors in stderr" && check_stderr
72 t_begin
"silence is golden" && {