Greg.mpls / gmail.com wrote:
> The test `TestSocket_BasicSocket#test_read_write_nonblock` was recently add via [58400](https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/58400/diff) / [c32fc82](https://github.com/ruby/ruby/commit/c32fc82d0ed8bcf0d6e4de8518bbb7bd808a69b8).
> 
> On a MinGW build, it fails.  The following change [at line 197](https://github.com/ruby/ruby/blob/c32fc82d0ed8bcf0d6e4de8518bbb7bd808a69b8/test/socket/test_basicsocket.rb#L197) allows a MinGW build to pass.
> 
> ```ruby
>       case r = ssock.read_nonblock(16384, buf, exception: false)
>       when String
>         next
>       when nil
>         break
>       else
> -       flunk "unexpected read_nonblock return: #{r.inspect}"
> +       flunk "unexpected read_nonblock return: #{r.inspect}" unless set_nb
>       end while true
> ```

Oops, but wouldn't checking for :wait_readable be more correct?
Can you try the following, instead?

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 @@ def test_read_write_nonblock
         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

Thanks.

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>