about summary refs log tree commit homepage
path: root/t/t0003-reopen-logs.sh
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-11-09 12:01:22 -0800
committerEric Wong <normalperson@yhbt.net>2009-11-09 12:01:22 -0800
commitbf34080bf370807a2c16ba6efbfef1598fcb341d (patch)
tree3291f3d6028383800a8670b4624128ab2f1d915d /t/t0003-reopen-logs.sh
parent2020706b1edbc12319f01eab0bfa000877ca86ab (diff)
downloadrainbows-bf34080bf370807a2c16ba6efbfef1598fcb341d.tar.gz
In Unicorn, the master reopens logs before the workers do in
case the workers die while reopening logs.  But for our test
cases (and real-world usage) we need to ensure the workers have
reopened logs as well.
Diffstat (limited to 't/t0003-reopen-logs.sh')
-rwxr-xr-xt/t0003-reopen-logs.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/t/t0003-reopen-logs.sh b/t/t0003-reopen-logs.sh
index 822de8b..910a0a5 100755
--- a/t/t0003-reopen-logs.sh
+++ b/t/t0003-reopen-logs.sh
@@ -3,7 +3,7 @@
 nr_client=${nr_client-2}
 . ./test-lib.sh
 
-t_plan 18 "reopen rotated logs"
+t_plan 19 "reopen rotated logs"
 
 t_begin "setup and startup" && {
         rtmpfiles curl_out curl_err r_rot
@@ -44,6 +44,16 @@ t_begin "wait for rotated log to reappear" && {
         done
 }
 
+t_begin "wait for worker to reopen logs" && {
+        nr=60
+        re="worker=.* done reopening logs"
+        while ! grep "$re" < $r_err >/dev/null && test $nr -ge 0
+        do
+                sleep 1
+                nr=$(( $nr - 1 ))
+        done
+}
+
 dbgcat r_rot
 dbgcat r_err