mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
don't sleep indefinitely. collect the zombie.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9283449812
commit
0365096bfe
1 changed files with 6 additions and 3 deletions
|
@ -47,16 +47,19 @@ class TestWEBrickServer < Test::Unit::TestCase
|
||||||
def test_daemon
|
def test_daemon
|
||||||
begin
|
begin
|
||||||
r, w = IO.pipe
|
r, w = IO.pipe
|
||||||
Process.fork{
|
pid1 = Process.fork{
|
||||||
r.close
|
r.close
|
||||||
WEBrick::Daemon.start
|
WEBrick::Daemon.start
|
||||||
w.puts(Process.pid)
|
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
|
rescue NotImplementedError
|
||||||
# snip this test
|
# snip this test
|
||||||
ensure
|
ensure
|
||||||
|
Process.wait(pid1) if pid1
|
||||||
r.close
|
r.close
|
||||||
w.close
|
w.close
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue