[#80531] Re: [ruby-cvs:65407] normal:r58236 (trunk): thread.c: comments on M:N threading [ci skip] — Eric Wong <normalperson@...>

SASADA Koichi <ko1@ruby-lang.org> wrote:

24 messages 2017/04/02
[#80532] Re: [ruby-cvs:65407] normal:r58236 (trunk): thread.c: comments on M:N threading [ci skip] — SASADA Koichi <ko1@...> 2017/04/02

On 2017/04/02 11:35, Eric Wong wrote:

[#80540] Re: [ruby-cvs:65407] normal:r58236 (trunk): thread.c: comments on M:N threading [ci skip] — Eric Wong <normalperson@...> 2017/04/03

SASADA Koichi <ko1@atdot.net> wrote:

[#81027] Re: [ruby-cvs:65407] normal:r58236 (trunk): thread.c: comments on M:N threading [ci skip] — Eric Wong <normalperson@...> 2017/05/08

Eric Wong <normalperson@yhbt.net> wrote:

[#81028] Re: [ruby-cvs:65407] normal:r58236 (trunk): thread.c: comments on M:N threading [ci skip] — SASADA Koichi <ko1@...> 2017/05/08

On 2017/05/08 9:33, Eric Wong wrote:

[#81029] Re: [ruby-cvs:65407] normal:r58236 (trunk): thread.c: comments on M:N threading [ci skip] — SASADA Koichi <ko1@...> 2017/05/08

On 2017/05/08 10:53, SASADA Koichi wrote:

[#81031] Re: [ruby-cvs:65407] normal:r58236 (trunk): thread.c: comments on M:N threading [ci skip] — Eric Wong <normalperson@...> 2017/05/08

SASADA Koichi <ko1@atdot.net> wrote:

[#81033] Re: [ruby-cvs:65407] normal:r58236 (trunk): thread.c: comments on M:N threading [ci skip] — SASADA Koichi <ko1@...> 2017/05/08

On 2017/05/08 12:01, Eric Wong wrote:

[#81035] Re: [ruby-cvs:65407] normal:r58236 (trunk): thread.c: comments on M:N threading [ci skip] — Eric Wong <normalperson@...> 2017/05/08

SASADA Koichi <ko1@atdot.net> wrote:

[#81042] Re: [ruby-cvs:65407] normal:r58236 (trunk): thread.c: comments on M:N threading [ci skip] — SASADA Koichi <ko1@...> 2017/05/09

On 2017/05/08 15:36, Eric Wong wrote:

[#81044] Re: [ruby-cvs:65407] normal:r58236 (trunk): thread.c: comments on M:N threading [ci skip] — Eric Wong <normalperson@...> 2017/05/09

SASADA Koichi <ko1@atdot.net> wrote:

[#81045] Re: [ruby-cvs:65407] normal:r58236 (trunk): thread.c: comments on M:N threading [ci skip] — SASADA Koichi <ko1@...> 2017/05/09

On 2017/05/09 12:38, Eric Wong wrote:

[#81047] Re: [ruby-cvs:65407] normal:r58236 (trunk): thread.c: comments on M:N threading [ci skip] — Eric Wong <normalperson@...> 2017/05/09

SASADA Koichi <ko1@atdot.net> wrote:

[ruby-core:80820] Re: [Ruby trunk Bug#13491] MinGW 58400 - TestSocket_BasicSocket#test_read_write_nonblock

From: Eric Wong <normalperson@...>
Date: 2017-04-21 17:03:35 UTC
List: ruby-core #80820
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>

In This Thread