From 0365096bfe70ce7a78f55901dff5058dfbf46d44 Mon Sep 17 00:00:00 2001 From: akr Date: Fri, 7 May 2010 15:07:11 +0000 Subject: don't sleep indefinitely. collect the zombie. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/webrick/test_server.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/webrick/test_server.rb b/test/webrick/test_server.rb index 99c59d5056..e00449692b 100644 --- a/test/webrick/test_server.rb +++ b/test/webrick/test_server.rb @@ -47,16 +47,19 @@ class TestWEBrickServer < Test::Unit::TestCase def test_daemon begin r, w = IO.pipe - Process.fork{ + pid1 = Process.fork{ r.close WEBrick::Daemon.start w.puts(Process.pid) - sleep + sleep 10 } - assert(Process.kill(:KILL, r.gets.to_i)) + pid2 = r.gets.to_i + assert(Process.kill(:KILL, pid2)) + assert_not_equal(pid1, pid2) rescue NotImplementedError # snip this test ensure + Process.wait(pid1) if pid1 r.close w.close end -- cgit v1.2.3