Sha256: b1bb18d9f56835b3e344baa91f323344eb405601f9923d85167282a391e030a5

Contents?: true

Size: 1.13 KB

Versions: 12

Compression:

Stored size: 1.13 KB

Contents

#!/bin/sh
nr=${nr-5}
. ./test-lib.sh
case $model in
NeverBlock|EventMachine) ;;
*)
	t_info "skipping $T since it's not compatible with $model"
	exit 0
	;;
esac

t_plan 7 "async_app test for test for EM"

CONFIG_RU=async_examples/async_app.ru

t_begin "setup and start" && {
	rainbows_setup
	rtmpfiles a b c curl_err expect

	# this does not does not support Rack::Lint
	rainbows -E deployment -D $CONFIG_RU -c $unicorn_config
	rainbows_wait_start
}

t_begin "send async requests off in parallel" && {
	t0=$(unix_time)
	curl --no-buffer -sSf http://$listen/ > $a 2>> $curl_err &
	curl --no-buffer -sSf http://$listen/ > $b 2>> $curl_err &
	curl --no-buffer -sSf http://$listen/ > $c 2>> $curl_err &
}

t_begin "wait for curl terminations" && {
	wait
	t1=$(unix_time)
	elapsed=$(( $t1 - $t0 ))
	t_info "elapsed=$elapsed"
}

t_begin "termination signal sent" && {
	kill $rainbows_pid
}

t_begin "no errors from curl" && {
	test ! -s $curl_err
}

t_begin "no errors in stderr" && check_stderr

t_begin "responses match expected" && {
	echo 'Woah, async!' > $expect
	printf 'Cheers then!' >> $expect
	cmp $expect $a
	cmp $expect $b
	cmp $expect $c
}

t_done

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rainbows-5.2.1 t/t0400-em-async-app.sh
rainbows-5.2.0 t/t0400-em-async-app.sh
rainbows-5.1.1 t/t0400-em-async-app.sh
rainbows-5.1.0 t/t0400-em-async-app.sh
rainbows-5.0.0.5.ge717 t/t0400-em-async-app.sh
rainbows-5.0.0 t/t0400-em-async-app.sh
rainbows-4.7.0 t/t0400-em-async-app.sh
rainbows-4.6.2 t/t0400-em-async-app.sh
rainbows-4.6.1 t/t0400-em-async-app.sh
rainbows-4.6.0.4.g4108 t/t0400-em-async-app.sh
rainbows-4.6.0 t/t0400-em-async-app.sh
rainbows-4.5.0 t/t0400-em-async-app.sh