diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-05-07 15:07:11 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-05-07 15:07:11 +0000 |
commit | 0365096bfe70ce7a78f55901dff5058dfbf46d44 (patch) | |
tree | 80897df2ac020452f76d9caa308108789883673e /test/webrick | |
parent | 9283449812b49b5e52a24a888878838066fcf0bb (diff) | |
download | bundler-0365096bfe70ce7a78f55901dff5058dfbf46d44.tar.gz |
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/webrick')
-rw-r--r-- | test/webrick/test_server.rb | 9 |
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 |