ruby-changes:15733
From: akr <ko1@a...>
Date: Sat, 8 May 2010 00:07:20 +0900 (JST)
Subject: [ruby-changes:15733] Ruby:r27660 (trunk, ruby_1_8): don't sleep indefinitely. collect the zombie.
akr 2010-05-08 00:07:11 +0900 (Sat, 08 May 2010) New Revision: 27660 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=27660 Log: don't sleep indefinitely. collect the zombie. Modified files: branches/ruby_1_8/test/webrick/test_server.rb trunk/test/webrick/test_server.rb Index: test/webrick/test_server.rb =================================================================== --- test/webrick/test_server.rb (revision 27659) +++ test/webrick/test_server.rb (revision 27660) @@ -47,16 +47,19 @@ 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 Index: ruby_1_8/test/webrick/test_server.rb =================================================================== --- ruby_1_8/test/webrick/test_server.rb (revision 27659) +++ ruby_1_8/test/webrick/test_server.rb (revision 27660) @@ -47,16 +47,19 @@ 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/