From 44ff836e58dcfba6019ade3a4d661114434f3877 Mon Sep 17 00:00:00 2001 From: naruse Date: Fri, 7 May 2010 08:09:37 +0000 Subject: Revert r26058 "* test/webrick/test_server.rb (test_daemon): simply use fork's return" This must use pipe because the target for kill is not direct child. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/webrick/test_server.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'test/webrick/test_server.rb') diff --git a/test/webrick/test_server.rb b/test/webrick/test_server.rb index b688d52018..99c59d5056 100644 --- a/test/webrick/test_server.rb +++ b/test/webrick/test_server.rb @@ -46,13 +46,19 @@ class TestWEBrickServer < Test::Unit::TestCase def test_daemon begin - pid = Process.fork{ + r, w = IO.pipe + Process.fork{ + r.close WEBrick::Daemon.start + w.puts(Process.pid) sleep } - assert(Process.kill(:KILL, pid)) + assert(Process.kill(:KILL, r.gets.to_i)) rescue NotImplementedError # snip this test + ensure + r.close + w.close end end end -- cgit v1.2.3