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
This commit is contained in:
parent
5cea3d2b17
commit
44ff836e58
@ -46,13 +46,19 @@ class TestWEBrickServer < Test::Unit::TestCase
|
|||||||
|
|
||||||
def test_daemon
|
def test_daemon
|
||||||
begin
|
begin
|
||||||
pid = Process.fork{
|
r, w = IO.pipe
|
||||||
|
Process.fork{
|
||||||
|
r.close
|
||||||
WEBrick::Daemon.start
|
WEBrick::Daemon.start
|
||||||
|
w.puts(Process.pid)
|
||||||
sleep
|
sleep
|
||||||
}
|
}
|
||||||
assert(Process.kill(:KILL, pid))
|
assert(Process.kill(:KILL, r.gets.to_i))
|
||||||
rescue NotImplementedError
|
rescue NotImplementedError
|
||||||
# snip this test
|
# snip this test
|
||||||
|
ensure
|
||||||
|
r.close
|
||||||
|
w.close
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user