[前][次][番号順一覧][スレッド一覧]

ruby-changes:57513

From: Naohisa <ko1@a...>
Date: Tue, 3 Sep 2019 17:10:47 +0900 (JST)
Subject: [ruby-changes:57513] 83889292f5 (master): Examine TestIO#test_select_exceptfds on Solaris with 1 byte data

https://git.ruby-lang.org/ruby.git/commit/?id=83889292f5

From 83889292f5e0944d6762228c9ca81318f618aa4e Mon Sep 17 00:00:00 2001
From: Naohisa Goto <ngotogenome@g...>
Date: Tue, 3 Sep 2019 16:51:01 +0900
Subject: Examine TestIO#test_select_exceptfds on Solaris with 1 byte data

On Solaris, it seems that the select(3C) in this test works only
when sending 1 byte out-of-band data, though I cannot investigate
the cause. The behavior is observed on a Solaris 10 server in
addition to Solaris 11 on which the test had been skipped.

diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index 7849d81..ed60452 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -3837,14 +3837,16 @@ __END__ https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L3837
   end if IO.method_defined?(:pread) and IO.method_defined?(:pwrite)
 
   def test_select_exceptfds
-    if Etc.uname[:sysname] == 'SunOS' && Etc.uname[:release] == '5.11'
-      skip "Solaris 11 fails this"
+    if Etc.uname[:sysname] == 'SunOS'
+      str = 'h'.freeze #(???) Only 1 byte with MSG_OOB on Solaris
+    else
+      str = 'hello'.freeze
     end
 
     TCPServer.open('localhost', 0) do |svr|
       con = TCPSocket.new('localhost', svr.addr[1])
       acc = svr.accept
-      assert_equal 5, con.send('hello', Socket::MSG_OOB)
+      assert_equal str.length, con.send(str, Socket::MSG_OOB)
       set = IO.select(nil, nil, [acc], 30)
       assert_equal([[], [], [acc]], set, 'IO#select exceptions array OK')
       acc.close
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]