diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-11-24 08:23:26 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-11-24 08:23:26 +0000 |
commit | c0e20037f3fb16d75b55394e7bf0a1d3ef8b7b87 (patch) | |
tree | e822f676901e758a0b4f1750371403080a721567 /test | |
parent | 8c8e72fb8bf316850a3b8b5ca5f149f59b0c1449 (diff) |
io.c: wait on FD readability w/o GVL reacquisition
Since non-blocking I/O is the default after [Bug #14968],
we will hit it more often and cause more acquisition/release
of GVL to wait on single FD.
This also lets us avoid touching the temporal string locking
as much and lets us clean up some test changes made for
[Bug #14968]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_io.rb | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 9d0e5bc411..a933c93866 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -1360,7 +1360,6 @@ class TestIO < Test::Unit::TestCase def test_readpartial_lock with_pipe do |r, w| s = "" - r.nonblock = false if have_nonblock? t = Thread.new { r.readpartial(5, s) } Thread.pass until t.stop? assert_raise(RuntimeError) { s.clear } @@ -3256,17 +3255,12 @@ __END__ assert_equal 100, buf.bytesize - begin + msg = /can't modify string; temporarily locked/ + assert_raise_with_message(RuntimeError, msg) do buf.replace("") - rescue RuntimeError => e - assert_match(/can't modify string; temporarily locked/, e.message) - Thread.pass - end until buf.empty? - - assert_empty(buf, bug6099) + end assert_predicate(th, :alive?) w.write(data) - Thread.pass while th.alive? th.join end assert_equal(data, buf, bug6099) |