Bug #7420

Writeable pipe and timeout tests are failing (MinGW)

Added by Luis Lavena over 1 year ago. Updated over 1 year ago.

[ruby-core:49831]
Status:Closed
Priority:Normal
Assignee:Nobuyoshi Nakada
Category:test
Target version:2.0.0
ruby -v:ruby 2.0.0dev (2012-11-22 trunk 37790) [i386-mingw32] Backport:

Description

=begin

The tests added in r37785, associated with Feature #4646 might require a guard against Windows because are failing in the Windows CI:

http://ci.rubyinstaller.org/job/ruby-trunk-x64-test-all/246/console
http://ci.rubyinstaller.org/job/ruby-trunk-x86-test-all/346/console

1) Error:
testwaitwritableEPIPE(TestIOWait):
Errno::EWOULDBLOCK: A non-blocking socket operation could not be completed immediately. - write would block
C:/Users/Luis/Code/ruby/ruby/test/io/wait/test
iowait.rb:103:in write_nonblock'
C:/Users/Luis/Code/ruby/ruby/test/io/wait/test_io_wait.rb:103:in
fill
pipe'
C:/Users/Luis/Code/ruby/ruby/test/io/wait/testiowait.rb:87:in `testwaitwritable_EPIPE'

2) Error:
testwaitwritabletimeout(TestIOWait):
Errno::EWOULDBLOCK: A non-blocking socket operation could not be completed immediately. - write would block
C:/Users/Luis/Code/ruby/ruby/test/io/wait/test
iowait.rb:103:in write_nonblock'
C:/Users/Luis/Code/ruby/ruby/test/io/wait/test_io_wait.rb:103:in
fill
pipe'
C:/Users/Luis/Code/ruby/ruby/test/io/wait/testiowait.rb:80:in `testwaitwritable_timeout'

=end

Associated revisions

Revision 37984
Added by Nobuyoshi Nakada over 1 year ago

testiowait.rb: Bug #7420

  • test/io/wait/testiowait.rb (TestIOWait#fill_pipe): Errno::EWOULDBLOCK may not be the same as Errno::EAGAIN. patch by phasis68 (Heesob Park) at . [Bug #7420]

History

#1 Updated by Heesob Park over 1 year ago

As I know, Errno::EWOULDBLOCK is not the same as Errno::EAGAIN on Windows.

Here is a patch:
diff --git a/testiowait.rb b/testiowait.rb.new
index 676809c..c322efd 100644
--- a/testiowait.rb
+++ b/testiowait.rb.new
@@ -101,7 +101,7 @@ private
buf = " " * 4096
begin
written += @w.write_nonblock(buf)
- rescue Errno::EAGAIN
+ rescue Errno::EAGAIN,Errno::EWOULDBLOCK
return written
end while true
end

#2 Updated by Nobuyoshi Nakada over 1 year ago

Thank you for the pointing out.

Since SystemCallError.=== matches by the errno values, so it works on platforms where they are just aliases, but EAGAIN and EWOULDBLOCK were actually different on Windows.
Should Errno::EAGAIN match an instance of Errno::EWOULDBLOCK on every platforms where those are defined?

#3 Updated by Nobuyoshi Nakada over 1 year ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r37984.
Luis, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


testiowait.rb: Bug #7420

  • test/io/wait/testiowait.rb (TestIOWait#fill_pipe): Errno::EWOULDBLOCK may not be the same as Errno::EAGAIN. patch by phasis68 (Heesob Park) at . [Bug #7420]

Also available in: Atom PDF