ruby-changes:54431
From: normal <ko1@a...>
Date: Sun, 30 Dec 2018 09:46:06 +0900 (JST)
Subject: [ruby-changes:54431] normal:r66646 (trunk): accept_nonblock_spec: IO.select instead of sleep
normal 2018-12-30 09:46:02 +0900 (Sun, 30 Dec 2018) New Revision: 66646 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66646 Log: accept_nonblock_spec: IO.select instead of sleep Waiting on socket I/O using IO.select should work on all platforms. Modified files: trunk/spec/ruby/library/socket/tcpserver/accept_nonblock_spec.rb Index: spec/ruby/library/socket/tcpserver/accept_nonblock_spec.rb =================================================================== --- spec/ruby/library/socket/tcpserver/accept_nonblock_spec.rb (revision 66645) +++ spec/ruby/library/socket/tcpserver/accept_nonblock_spec.rb (revision 66646) @@ -18,7 +18,7 @@ describe "Socket::TCPServer.accept_nonbl https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/socket/tcpserver/accept_nonblock_spec.rb#L18 }.should raise_error(IO::WaitReadable) c = TCPSocket.new("127.0.0.1", @port) - sleep 0.1 + IO.select([@server]) s = @server.accept_nonblock port, address = Socket.unpack_sockaddr_in(s.getsockname) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/