From 662a146457689110c83bfd18987938475966f454 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 7 Feb 2011 19:26:04 -0800 Subject: new test for optional :pool_size handling This will help prevent us from breaking :pool_size in the future. --- t/t0041-optional-pool-size.sh | 51 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100755 t/t0041-optional-pool-size.sh diff --git a/t/t0041-optional-pool-size.sh b/t/t0041-optional-pool-size.sh new file mode 100755 index 0000000..63792c3 --- /dev/null +++ b/t/t0041-optional-pool-size.sh @@ -0,0 +1,51 @@ +#!/bin/sh +. ./test-lib.sh + +case $model in +NeverBlock|CoolioThreadPool) ;; +*) + t_info "skipping $T since it doesn't support :pool_size" + exit + ;; +esac + +t_plan 6 "optional :pool_size argument for $model" + +t_begin "setup and startup" && { + rtmpfiles curl_out curl_err + rainbows_setup $model +} + +t_begin "fails with bad :pool_size" && { + ed -s $unicorn_config < -666/ +w +EOF + grep "pool_size" $unicorn_config + rainbows -D env.ru -c $unicorn_config || echo err=$? > $ok + test x"$(cat $ok)" = "xerr=1" +} + +t_begin "starts with correct :pool_size" && { + ed -s $unicorn_config < 6/ +w +EOF + grep "pool_size" $unicorn_config + rainbows -D env.ru -c $unicorn_config + rainbows_wait_start +} + +t_begin "regular TCP request works right" && { + curl -sSfv http://$listen/ +} + +t_begin "no errors in stderr" && { + check_stderr +} + +t_begin "shutdown" && { + kill $rainbows_pid +} + +t_done -- cgit v1.2.3-24-ge0c7