diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_notimp.rb | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/test/ruby/test_notimp.rb b/test/ruby/test_notimp.rb index 04f1d8550d..6733d0ce0e 100644 --- a/test/ruby/test_notimp.rb +++ b/test/ruby/test_notimp.rb @@ -22,16 +22,17 @@ class TestNotImplement < Test::Unit::TestCase def test_call_fork pid = nil - GC.start - Timeout.timeout(1) { - pid = fork {} - Process.wait pid - pid = nil - } - ensure - if pid - Process.kill :KILL, pid + begin + Timeout.timeout(1) { + pid = fork {} + Process.wait pid + pid = nil + } + rescue Timeout::Error + ps = `ps -l #{pid}` + Process.kill(:KILL, pid) Process.wait pid + assert_equal nil, pid, ps end end if Process.respond_to?(:fork) |