kgio RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* Current test failures on OpenBSD
@ 2011-11-15  0:42 Jeremy Evans
  2011-11-15  3:26 ` Eric Wong
  0 siblings, 1 reply; 6+ messages in thread
From: Jeremy Evans @ 2011-11-15  0:42 UTC (permalink / raw)
  To: kgio

Here are the current test failures on OpenBSD.  I'm using the patch
below to run all tests even if a test fails.

Jeremy

  1) Failure:
test_accept_flags(TestAcceptFlags) [test/test_accept_flags.rb:25]:
<false> is not true.

  1) Failure:
test_tcp_socket_new_invalid(TestKgioTcpConnect) [test/test_tcp_connect.rb:47]:
<TypeError> exception expected but was
Class: <ArgumentError>
Message: <"invalid TCP port: 1055759040">
---Backtrace---
test/test_tcp_connect.rb:47:in `new'
test/test_tcp_connect.rb:47:in `test_tcp_socket_new_invalid'
test/test_tcp_connect.rb:47:in `test_tcp_socket_new_invalid'
---------------

  1) Failure:                                                                                                                                         [38/1327]
test_blocking_accept_flags(TestKgioUNIXServer) [./test/lib_server_accept.rb:37]:
<false> expected but was
<true>.

  2) Failure:
test_tryaccept_flags(TestKgioUNIXServer) [./test/lib_server_accept.rb:28]:
<false> expected but was
<true>.

  1) Failure:
test_blocking_accept_flags(TestKgioTCPServer) [./test/lib_server_accept.rb:37]:
<false> expected but was
<true>.

  2) Failure:
test_tryaccept_flags(TestKgioTCPServer) [./test/lib_server_accept.rb:28]:
<false> expected but was
<true>.

--- pkg.mk.orig Tue Nov 15 01:14:49 2011
+++ pkg.mk      Tue Nov 15 01:15:01 2011
@@ -147,7 +147,7 @@ test_units := $(wildcard test/test_*.rb)
 test: test-unit
 test-unit: $(test_units)
 $(test_units): build
-       $(RUBY) -I $(lib) $@ $(RUBY_TEST_OPTS)
+       -$(RUBY) -I $(lib) $@ $(RUBY_TEST_OPTS)

 # this requires GNU coreutils variants
 ifneq ($(RSYNC_DEST),)


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Current test failures on OpenBSD
  2011-11-15  0:42 Current test failures on OpenBSD Jeremy Evans
@ 2011-11-15  3:26 ` Eric Wong
  2011-11-15 15:52   ` Jeremy Evans
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Wong @ 2011-11-15  3:26 UTC (permalink / raw)
  To: kgio

Jeremy Evans <code@jeremyevans.net> wrote:
> Here are the current test failures on OpenBSD.  I'm using the patch
> below to run all tests even if a test fails.
> 
> Jeremy
> 
>   1) Failure:
> test_accept_flags(TestAcceptFlags) [test/test_accept_flags.rb:25]:
> <false> is not true.

That might be a bad test, is this on MRI 1.8.7 or 1.9.x?
There's a huge difference in how accept() works between them.

Heck, the test /passing/ is probably indicative of a bug in 1.8 code
since that doesn't use both Linux and the kgio_* methods on the given
sockets...

>   1) Failure:
> test_tcp_socket_new_invalid(TestKgioTcpConnect) [test/test_tcp_connect.rb:47]:
> <TypeError> exception expected but was
> Class: <ArgumentError>
> Message: <"invalid TCP port: 1055759040">
> ---Backtrace---
> test/test_tcp_connect.rb:47:in `new'
> test/test_tcp_connect.rb:47:in `test_tcp_socket_new_invalid'
> test/test_tcp_connect.rb:47:in `test_tcp_socket_new_invalid'
> ---------------

Should've been fixed in kgio.git (commit
d064ac9334be079d0e830bc2361c065cbaa52a64)

>   1) Failure:                                                                                                                                         [38/1327]
> test_blocking_accept_flags(TestKgioUNIXServer) [./test/lib_server_accept.rb:37]:
> <false> expected but was
> <true>.

Looks like the same class of failure for all the accept() tests...

kgio also attempts to allow the same listen socket to be shared
between a 1.8.7 and 1.9.2 process during accept()

>   2) Failure:
> test_tryaccept_flags(TestKgioUNIXServer) [./test/lib_server_accept.rb:28]:
> <false> expected but was
> <true>.
> 
>   1) Failure:
> test_blocking_accept_flags(TestKgioTCPServer) [./test/lib_server_accept.rb:37]:
> <false> expected but was
> <true>.
> 
>   2) Failure:
> test_tryaccept_flags(TestKgioTCPServer) [./test/lib_server_accept.rb:28]:
> <false> expected but was
> <true>.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Current test failures on OpenBSD
  2011-11-15  3:26 ` Eric Wong
@ 2011-11-15 15:52   ` Jeremy Evans
  2011-11-15 21:01     ` Eric Wong
  0 siblings, 1 reply; 6+ messages in thread
From: Jeremy Evans @ 2011-11-15 15:52 UTC (permalink / raw)
  To: kgio

On 11/15 03:26, Eric Wong wrote:
> Jeremy Evans <code@jeremyevans.net> wrote:
> >   1) Failure:
> > test_accept_flags(TestAcceptFlags) [test/test_accept_flags.rb:25]:
> > <false> is not true.
> 
> That might be a bad test, is this on MRI 1.8.7 or 1.9.x?
> There's a huge difference in how accept() works between them.

Eric,
 
Sorry for not being more specific earlier.  It only happens on 1.8.7.
The test passes on 1.9.3.

> >   1) Failure:                                                                                                                                         [38/1327]
> > test_blocking_accept_flags(TestKgioUNIXServer) [./test/lib_server_accept.rb:37]:
> > <false> expected but was
> > <true>.
> 
> Looks like the same class of failure for all the accept() tests...

This fails on 1.8.7 and passes on 1.9.3 on OpenBSD.

> kgio also attempts to allow the same listen socket to be shared
> between a 1.8.7 and 1.9.2 process during accept()
> 
> >   2) Failure:
> > test_tryaccept_flags(TestKgioUNIXServer) [./test/lib_server_accept.rb:28]:
> > <false> expected but was
> > <true>.

This fails on 1.8.7 and 1.9.3 on OpenBSD.

> >   1) Failure:
> > test_blocking_accept_flags(TestKgioTCPServer) [./test/lib_server_accept.rb:37]:
> > <false> expected but was
> > <true>.

This fails on 1.8.7 and passes on 1.9.3 on OpenBSD.

> >   2) Failure:
> > test_tryaccept_flags(TestKgioTCPServer) [./test/lib_server_accept.rb:28]:
> > <false> expected but was
> > <true>.

This fails on 1.8.7 and 1.9.3 on OpenBSD.

Should the 5 accept tests that fail on 1.8.7 just be skipped?

It looks like the tryaccept flag isn't supported on OpenBSD, or at least
that it doesn't set the returned socket to nonblocking.  Should those tests
be skipped on OpenBSD, or could there a bug in the code?

Thanks for your help,
Jeremy


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Current test failures on OpenBSD
  2011-11-15 15:52   ` Jeremy Evans
@ 2011-11-15 21:01     ` Eric Wong
  2011-11-15 21:35       ` Eric Wong
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Wong @ 2011-11-15 21:01 UTC (permalink / raw)
  To: kgio

Jeremy Evans <code@jeremyevans.net> wrote:
> Should the 5 accept tests that fail on 1.8.7 just be skipped?

Yes, on all systems.

I now recall sockets created from accept() will inherit the O_NONBLOCK
flag on some (or all?) *BSDs from the listen socket.  And the listen
socket calling accept() _must_always_ have the O_NONBLOCK flag set when
using green threads.

O_NONBLOCK with Ruby is really an implementation detail and mostly
irrelevant for non-listen sockets.  All the *_nonblock methods in Ruby
and the kgio_try* methods always ensure O_NONBLOCK is set to avoid
blocking.  When emulating blocking, Ruby/kgio will just select() if it
hits EAGAIN if O_NONBLOCK happens to be set (with either green or native
threads)

> It looks like the tryaccept flag isn't supported on OpenBSD, or at least
> that it doesn't set the returned socket to nonblocking.  Should those tests
> be skipped on OpenBSD, or could there a bug in the code?

Buggy tests in general :x

I'll fix the tests and documentation in a few.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Current test failures on OpenBSD
  2011-11-15 21:01     ` Eric Wong
@ 2011-11-15 21:35       ` Eric Wong
  2011-11-16  1:56         ` Jeremy Evans
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Wong @ 2011-11-15 21:35 UTC (permalink / raw)
  To: kgio

Eric Wong <normalperson@yhbt.net> wrote:
> I'll fix the tests and documentation in a few.

I've pushed out the following changes to
master on git://bogomips.org/kgio.git

(commit 48dc3c5a1943801311567e72a8e69fcb0cd8cf8d)

Eric Wong (3):
      accept: always set O_NONBLOCK for accept()-ed sockets in 1.8
      accept: deprecate singleton Kgio.accept_* methods
      tests: remove tests for IO#nonblock? after accept

Can you please test?  Thanks!


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Current test failures on OpenBSD
  2011-11-15 21:35       ` Eric Wong
@ 2011-11-16  1:56         ` Jeremy Evans
  0 siblings, 0 replies; 6+ messages in thread
From: Jeremy Evans @ 2011-11-16  1:56 UTC (permalink / raw)
  To: kgio

On 11/15 01:35, Eric Wong wrote:
> Eric Wong <normalperson@yhbt.net> wrote:
> > I'll fix the tests and documentation in a few.
> 
> I've pushed out the following changes to
> master on git://bogomips.org/kgio.git
> 
> (commit 48dc3c5a1943801311567e72a8e69fcb0cd8cf8d)
> 
> Eric Wong (3):
>       accept: always set O_NONBLOCK for accept()-ed sockets in 1.8
>       accept: deprecate singleton Kgio.accept_* methods
>       tests: remove tests for IO#nonblock? after accept
> 
> Can you please test?  Thanks!

Eric,

Passes all tests on OpenBSD.

Thanks,
Jeremy


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-11-16  1:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-15  0:42 Current test failures on OpenBSD Jeremy Evans
2011-11-15  3:26 ` Eric Wong
2011-11-15 15:52   ` Jeremy Evans
2011-11-15 21:01     ` Eric Wong
2011-11-15 21:35       ` Eric Wong
2011-11-16  1:56         ` Jeremy Evans

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/kgio.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).