1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Get ps result if fork-wait is timeouted

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2013-06-27 10:16:17 +00:00
parent 0f73dde5da
commit 044387a1d7

View file

@ -22,16 +22,17 @@ class TestNotImplement < Test::Unit::TestCase
def test_call_fork def test_call_fork
pid = nil pid = nil
GC.start begin
Timeout.timeout(1) { Timeout.timeout(1) {
pid = fork {} pid = fork {}
Process.wait pid Process.wait pid
pid = nil pid = nil
} }
ensure rescue Timeout::Error
if pid ps = `ps -l #{pid}`
Process.kill :KILL, pid Process.kill(:KILL, pid)
Process.wait pid Process.wait pid
assert_equal nil, pid, ps
end end
end if Process.respond_to?(:fork) end if Process.respond_to?(:fork)