diff options
author | Yusuke Endoh <mame@ruby-lang.org> | 2019-05-26 17:19:46 +0900 |
---|---|---|
committer | Yusuke Endoh <mame@ruby-lang.org> | 2019-05-26 17:23:14 +0900 |
commit | 4668a3a9da9f02b073631013e71722868ceafa53 (patch) | |
tree | da4b3288693f7bc88238063af1e01029451d99d1 /test/ruby/test_rubyoptions.rb | |
parent | 02b39daef834890981689f1f697c7c25cad55dd6 (diff) |
test/lib/envutil.rb (EnvUtil.timeout): added.
It is a wrapper for Timeout.timeout with the scale factor applied.
Diffstat (limited to 'test/ruby/test_rubyoptions.rb')
-rw-r--r-- | test/ruby/test_rubyoptions.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index 7dcae0c0e9..96edaca6f3 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -633,7 +633,7 @@ class TestRubyOptions < Test::Unit::TestCase assert_match(/hello world/, ps) assert_operator now, :<, stop Process.kill :KILL, pid - Timeout.timeout(5) { Process.wait(pid) } + EnvUtil.timeout(5) { Process.wait(pid) } end end @@ -790,9 +790,8 @@ class TestRubyOptions < Test::Unit::TestCase m.print("\C-d") pid = spawn(EnvUtil.rubybin, :in => s, :out => w) w.close - timeout = EnvUtil.apply_timeout_scale(3) assert_nothing_raised('[ruby-dev:37798]') do - result = Timeout.timeout(timeout) {r.read} + result = EnvUtil.timeout(3) {r.read} end Process.wait pid } |