path: root/test/io/wait/test_io_wait.rb
diff options
authorodaira <odaira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-09 00:28:41 +0000
committerodaira <odaira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-09 00:28:41 +0000
commit8f5cbc589c13c44ff7e6c539ce759cfc4a9287c1 (patch)
treeef82ea8c0dc25cd0c3ec20174f5dcfcdb3c4410f /test/io/wait/test_io_wait.rb
parent96e0b7d45f19d5626c1264085ca72f87f0fdf9a0 (diff)
* test/io/wait/test_io_wait.rb (test_wait_readwrite_timeout):
select(2) in AIX returns "readable" for the write-side fd of a pipe, so it is not possible to use a pipe to test the read-write timeout of IO#wait on AIX. git-svn-id: svn+ssh:// b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/io/wait/test_io_wait.rb')
1 files changed, 8 insertions, 1 deletions
diff --git a/test/io/wait/test_io_wait.rb b/test/io/wait/test_io_wait.rb
index 6c6fd83116e..2c1073d1044 100644
--- a/test/io/wait/test_io_wait.rb
+++ b/test/io/wait/test_io_wait.rb
@@ -141,7 +141,14 @@ class TestIOWait < Test::Unit::TestCase
def test_wait_readwrite_timeout
assert_equal @w, @w.wait(0.01, :read_write)
written = fill_pipe
- assert_nil @w.wait(0.01, :read_write)
+ if /aix/ =~ RUBY_PLATFORM
+ # IO#wait internally uses select(2) on AIX.
+ # AIX's select(2) returns "readable" for the write-side fd
+ # of a pipe, so @w.wait(0.01, :read_write) does not return nil.
+ assert_equal @w, @w.wait(0.01, :read_write)
+ else
+ assert_nil @w.wait(0.01, :read_write)
+ end
assert_equal @w, @w.wait(0.01, :read_write)