summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-07 15:07:11 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-07 15:07:11 +0000
commit0365096bfe70ce7a78f55901dff5058dfbf46d44 (patch)
tree80897df2ac020452f76d9caa308108789883673e /test
parent9283449812b49b5e52a24a888878838066fcf0bb (diff)
don't sleep indefinitely. collect the zombie.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/webrick/test_server.rb9
1 files 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