зеркало из https://github.com/github/ruby.git
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:
Родитель
5cea3d2b17
Коммит
44ff836e58
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче