mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
e3b98ca301
commit
e4ef5b282b
1 changed files with 10 additions and 7 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue