From 1c0dab453688e8bfc9f21656e9b89b88fb3cc1d3 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 17 Oct 2009 22:42:56 -0700 Subject: [PATCH] tests: for log reopening for all concurrency models --- ...-revactor-reopen-logs.sh => lib-reopen-logs.sh} | 19 +++++--- t/t1003-thread-pool-reopen-logs.sh | 2 + t/t2003-thread-spawn-reopen-logs.sh | 2 + t/t3003-revactor-reopen-logs.sh | 55 +--------------------- t/t4003-rev-reopen-logs.sh | 2 + t/test-lib.sh | 0 6 files changed, 21 insertions(+), 59 deletions(-) copy t/{t3003-revactor-reopen-logs.sh => lib-reopen-logs.sh} (67%) mode change 100755 => 100644 create mode 100755 t/t1003-thread-pool-reopen-logs.sh create mode 100755 t/t2003-thread-spawn-reopen-logs.sh rewrite t/t3003-revactor-reopen-logs.sh (98%) create mode 100755 t/t4003-rev-reopen-logs.sh mode change 100644 => 100755 t/test-lib.sh diff --git a/t/t3003-revactor-reopen-logs.sh b/t/lib-reopen-logs.sh old mode 100755 new mode 100644 similarity index 67% copy from t/t3003-revactor-reopen-logs.sh copy to t/lib-reopen-logs.sh index 47b2eaf..ace223a --- a/t/t3003-revactor-reopen-logs.sh +++ b/t/lib-reopen-logs.sh @@ -1,21 +1,18 @@ #!/bin/sh +# don't set nr_client for Rev, only _one_ app running at once :x +nr_client=${nr_client-2} . ./test-lib.sh eval $(unused_listen) rtmpfiles unicorn_config curl_out curl_err pid r_err r_out r_rot -nr_client=30 -nr_actor=10 cat > $unicorn_config < $unicorn_config <> $curl_out 2>> $curl_err ) & -done -! grep Error $r_err - -rm $r_rot -mv $r_err $r_rot - -kill -USR1 $(cat $pid) -wait_for_pid $r_err - -dbgcat r_rot -dbgcat r_err - -wait -echo elapsed=$(( $(date +%s) - $start )) -! test -s $curl_err -test x"$(wc -l < $curl_out)" = x$nr_client -nr=$(sort < $curl_out | uniq | wc -l) - -test "$nr" -eq 1 -test x$(sort < $curl_out | uniq) = xHello -! grep Error $r_err -! grep Error $r_rot - -kill $(cat $pid) -dbgcat r_err -! grep Error $r_err +#!/bin/sh +. ./lib-reopen-logs.sh diff --git a/t/t4003-rev-reopen-logs.sh b/t/t4003-rev-reopen-logs.sh new file mode 100755 index 0000000..6bba7ef --- /dev/null +++ b/t/t4003-rev-reopen-logs.sh @@ -0,0 +1,2 @@ +#!/bin/sh +. ./lib-reopen-logs.sh diff --git a/t/test-lib.sh b/t/test-lib.sh old mode 100644 new mode 100755 -- 2.11.4.GIT