From a8ed25ea123fbda606929eae513b812f3ee536d8 Mon Sep 17 00:00:00 2001 From: normal Date: Thu, 23 Oct 2014 01:37:04 +0000 Subject: test/ruby/test_process.rb: use io/wait instead of timeout Occasionally I get timeout errors during this test on an overloaded system, so we may need to increase timeouts anyways. For now, avoid the overhead of thread creation for every read we do. * test/ruby/test_process.rb (test_deadlock_by_signal_at_forking): use IO#wait_readable instead of timeout git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_process.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/ruby/test_process.rb') diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 2a13819dca..0738c50b69 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -1,6 +1,7 @@ require 'test/unit' require 'tempfile' require 'timeout' +require 'io/wait' require_relative 'envutil' require 'rbconfig' @@ -1946,13 +1947,12 @@ EOS ew.close begin loop do - Timeout.timeout(5) do - runner.readpartial(100) - end + runner.wait_readable(5) + runner.read_nonblock(100) end rescue EOFError => e _, status = Process.wait2(runner.pid) - rescue Timeout::Error => e + rescue IO::WaitReadable => e Process.kill(:INT, runner.pid) raise Marshal.load(er.read.unpack("m")[0]) end -- cgit v1.2.3