Sha256: 3af08367028431c92caf35d91f35b94edbe3e10cf75ffc9ee49e7079b144f11d

Contents?: true

Size: 1.08 KB

Versions: 11

Compression:

Stored size: 1.08 KB

Contents

#!/bin/sh
. ./test-lib.sh

t_plan 9 "graceful handling of broken apps for $model"

t_begin "setup and start" && {
	rainbows_setup $model 1
	rainbows -D t0009.ru -c $unicorn_config
	rainbows_wait_start
}

t_begin "normal response is alright" && {
	test xOK = x"$(curl -sSf http://$listen/)"
}

t_begin "app raised exception" && {
	curl -sSf http://$listen/raise 2> $tmp || :
	grep -F 500 $tmp
	> $tmp
}

t_begin "app exception logged and backtrace not swallowed" && {
	grep -F 'app error' $r_err
	grep -A1 -F 'app error' $r_err | tail -1 | grep t0009.ru:
	dbgcat r_err
	> $r_err
}

t_begin "trigger bad response" && {
	curl -sSf http://$listen/nil 2> $tmp || :
	grep -F 500 $tmp
	> $tmp
}

t_begin "app exception logged" && {
	grep -F 'app error' $r_err
	> $r_err
}

t_begin "normal responses alright afterwards" && {
	> $tmp
	curl -sSf http://$listen/ >> $tmp &
	curl -sSf http://$listen/ >> $tmp &
	curl -sSf http://$listen/ >> $tmp &
	curl -sSf http://$listen/ >> $tmp &
	wait
	test xOK = x$(sort < $tmp | uniq)
}

t_begin "teardown" && {
	kill $rainbows_pid
}

t_begin "check stderr" && check_stderr

t_done

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rainbows-0.94.0 t/t0009-broken-app.sh
rainbows-0.93.0 t/t0009-broken-app.sh
rainbows-0.92.0 t/t0009-broken-app.sh
rainbows-0.91.1 t/t0009-broken-app.sh
rainbows-0.91.0 t/t0009-broken-app.sh
rainbows-0.90.2 t/t0009-broken-app.sh
rainbows-0.90.1 t/t0009-broken-app.sh
rainbows-0.90.0 t/t0009-broken-app.sh
rainbows-0.9.0 t/t0009-broken-app.sh
rainbows-0.8.0 t/t0009-broken-app.sh
rainbows-0.7.0 t/t0009-broken-app.sh