aboutsummaryrefslogtreecommitdiffstats
path: root/test/socket
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-21 20:38:58 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-21 20:38:58 +0000
commite79ecc540f267b338056414b85edeb4a10e8ab4c (patch)
tree5bccc699ece155112cfcba6d3012a77b0a60d24b /test/socket
parent581c447ff93bdd8576e8532bc68891659a78d44e (diff)
downloadruby-e79ecc540f267b338056414b85edeb4a10e8ab4c.tar.gz
test/socket/test_basicsocket: handle :wait_readable on read_nonblock
On some systems with slower local sockets, :wait_readable may happen and we should wait on it to drain the socket. This is a possible fix for https://bugs.ruby-lang.org/issues/13491 * test/socket/test_basicsocket.rb (test_read_write_nonblock): handle :wait_readable on read_nonblock git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/socket')
-rw-r--r--test/socket/test_basicsocket.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/socket/test_basicsocket.rb b/test/socket/test_basicsocket.rb
index 0b13a7f1af..4d11521e9e 100644
--- a/test/socket/test_basicsocket.rb
+++ b/test/socket/test_basicsocket.rb
@@ -193,6 +193,9 @@ class TestSocket_BasicSocket < Test::Unit::TestCase
next
when nil
break
+ when :wait_readable
+ IO.select([ssock], nil, nil, 10) or
+ flunk 'socket did not become readable'
else
flunk "unexpected read_nonblock return: #{r.inspect}"
end while true