From 0af9343c98b7b8d9596b526b87fd5e67bb8c4a68 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 1 Nov 2009 01:15:01 -0700 Subject: tests: make timeout tests reliable under 1.9 We need to resort to SIGSTOP to block off processes entirely since 1.9 uses native threads. --- t/heartbeat-timeout.ru | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/t/heartbeat-timeout.ru b/t/heartbeat-timeout.ru index fff0c40..471bddc 100644 --- a/t/heartbeat-timeout.ru +++ b/t/heartbeat-timeout.ru @@ -4,8 +4,9 @@ headers = { 'Content-Type' => 'text/plain' } run lambda { |env| case env['PATH_INFO'] when "/block-forever" - # this should block forever (or until somebody opens it for reading) - File.open(fifo, "rb") { |fp| fp.syswrite("NEVER\n") } + # one of these should block forever + Process.kill(:STOP, $$) + ::File.open(fifo, "rb") { |fp| fp.syswrite("NEVER\n") } [ 500, headers, [ "Should never get here\n" ] ] else [ 200, headers, [ "#$$\n" ] ] -- cgit v1.2.3-24-ge0c7