diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-23 01:37:04 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-23 01:37:04 +0000 |
commit | a8ed25ea123fbda606929eae513b812f3ee536d8 (patch) | |
tree | a23ae561cdbe7cb054e2f98532875e759058d4ce | |
parent | 000e2b816d27980fb30cfb0ee60e92f4a87c50b8 (diff) | |
download | ruby-a8ed25ea123fbda606929eae513b812f3ee536d8.tar.gz |
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
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | test/ruby/test_process.rb | 8 |
2 files changed, 9 insertions, 4 deletions
@@ -1,3 +1,8 @@ +Thu Oct 23 10:22:41 2014 Eric Wong <e@80x24.org> + + * test/ruby/test_process.rb (test_deadlock_by_signal_at_forking): + use IO#wait_readable instead of timeout + Thu Oct 23 10:22:24 2014 Eric Wong <e@80x24.org> * test/ruby/test_process.rb (test_deadlock_by_signal_at_forking): 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 |