summaryrefslogtreecommitdiff
path: root/test/ruby/test_notimp.rb
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-18 04:43:21 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-18 04:43:21 +0000
commite4ef5b282be199cd6e20600610db44fd3920ad40 (patch)
tree7677cabdcdccf0eb393a5aa32abcb4149107c20e /test/ruby/test_notimp.rb
parente3b98ca301beaa34c09be7b20f9a7729b26f3eb1 (diff)
Add timeout to avoid stick
http://fbsd.rubyci.org/~chkbuild/ruby-trunk/log/20130618T030202Z.diff.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_notimp.rb')
-rw-r--r--test/ruby/test_notimp.rb17
1 files changed, 10 insertions, 7 deletions
diff --git a/test/ruby/test_notimp.rb b/test/ruby/test_notimp.rb
index c29119eac9..0ce0fc48a7 100644
--- a/test/ruby/test_notimp.rb
+++ b/test/ruby/test_notimp.rb
@@ -1,4 +1,5 @@
require 'test/unit'
+require 'timeout'
require 'tmpdir'
class TestNotImplement < Test::Unit::TestCase
@@ -20,13 +21,15 @@ class TestNotImplement < Test::Unit::TestCase
end
def test_call_fork
- if Process.respond_to?(:fork)
- assert_nothing_raised {
- pid = fork {}
- Process.wait pid
- }
- end
- end
+ pid = nil
+ Timeout.timeout(1) {
+ pid = fork {sleep}
+ Process.wait pid
+ pid = nil
+ }
+ ensure
+ Process.kill :KILL, pid if pid
+ end if Process.respond_to?(:fork)
def test_call_lchmod
if File.respond_to?(:lchmod)