aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-23 01:37:04 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-23 01:37:04 +0000
commita8ed25ea123fbda606929eae513b812f3ee536d8 (patch)
treea23ae561cdbe7cb054e2f98532875e759058d4ce
parent000e2b816d27980fb30cfb0ee60e92f4a87c50b8 (diff)
downloadruby-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--ChangeLog5
-rw-r--r--test/ruby/test_process.rb8
2 files changed, 9 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index be69c62c91..6c09ae439c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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