ruby-changes:54785
From: samuel <ko1@a...>
Date: Tue, 5 Feb 2019 11:19:57 +0900 (JST)
Subject: [ruby-changes:54785] samuel:r67004 (trunk): Make sure to wait for socket to be readable.
samuel 2019-02-05 11:19:51 +0900 (Tue, 05 Feb 2019) New Revision: 67004 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67004 Log: Make sure to wait for socket to be readable. Modified files: trunk/spec/ruby/library/socket/socket/udp_server_recv_spec.rb Index: spec/ruby/library/socket/socket/udp_server_recv_spec.rb =================================================================== --- spec/ruby/library/socket/socket/udp_server_recv_spec.rb (revision 67003) +++ spec/ruby/library/socket/socket/udp_server_recv_spec.rb (revision 67004) @@ -20,15 +20,8 @@ describe 'Socket.udp_server_recv' do https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/socket/socket/udp_server_recv_spec.rb#L20 @client.write('hello') - # FreeBSD sockets are not instanteous over loopback and - # will EAGAIN on recv. - platform_is :darwin, :freebsd do - IO.select([@server]) - end - - # TODO: remove it after debugging - # https://gist.github.com/ko1/0efd60ce78724d1c3bf313fc4b712c59#file-brlog-trunk-test-spec-20190204-141218-L402 - msg = :unset + readable, _, _ = IO.select([@server]) + readable.count.should == 1 Socket.udp_server_recv([@server]) do |message, source| msg = message -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/