From a7ac8393ea6a1767ba07f95e8932d06a9f9db398 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 9 Nov 2009 14:06:10 -0800 Subject: tests: ensure we process "START" from FIFO when starting Avoid the chances of misfiring when waiting on the master process to start in case something bad happens or we're sharing the FIFO for other purposes. --- t/t0004-heartbeat-timeout.sh | 2 +- t/test-lib.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/t/t0004-heartbeat-timeout.sh b/t/t0004-heartbeat-timeout.sh index d7a54a7..4aa8fd7 100755 --- a/t/t0004-heartbeat-timeout.sh +++ b/t/t0004-heartbeat-timeout.sh @@ -37,7 +37,7 @@ t_begin "ensure timeout took 3-6 seconds" && { } t_begin "wait for new worker to start up" && { - test x = x"$(cat $fifo)" + test xSTART = x"$(cat $fifo)" } t_begin "we get a fresh new worker process" && { diff --git a/t/test-lib.sh b/t/test-lib.sh index d28eaa0..1e22cb3 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -110,7 +110,7 @@ before_fork do |server, worker| # so notify the script on the first worker we spawn # by opening the FIFO if worker.nr == 0 - File.open("$fifo", "wb").close + File.open("$fifo", "wb") { |fp| fp.syswrite "START" } end end EOF @@ -130,7 +130,7 @@ EOF rainbows_wait_start () { # "cat $fifo" will block until the before_fork hook is called in # the Unicorn config file - test x = x"$(cat $fifo)" + test xSTART = x"$(cat $fifo)" rainbows_pid=$(cat $pid) } -- cgit v1.2.3-24-ge0c7