From: Andrew Hobson <ahobson@gmail.com>
To: mongrel-unicorn@rubyforge.org
Subject: Unicorn 4.7.0 tests fail on OSX 10.7.5 and debian squeeze
Date: Mon, 4 Nov 2013 13:04:43 -0500 [thread overview]
Message-ID: <014F1E10E50D4DA08811BBF10CC70038@gmail.com> (raw)
Hi,
I am getting failing tests on both OSX and debian squeeze, but the errors are different.
On both my machines, it is commit 7c125886b5862bf20711bae22e6697ad46141434 that breaks the tests.
I am using an old(ish) version of ruby: 1.9.3p125, but I don't think that should matter.
The error I get when I test 4.7.0 on OSX 10.7.5:
: Finished tests in 0.041678s, 263.9282 tests/s, 1943.4714 assertions/s.
:
: 1) Failure:
: test_reuseport(TestSocketHelper) [test/unit/test_socket_helper.rb:193]:
: <1> expected but was
: <512>.
:
: 11 tests, 81 assertions, 1 failures, 0 errors, 0 skips
I don't see how the current test can be platform independent. The following diff fixes OSX for me:
diff --git a/test/unit/test_socket_helper.rb b/test/unit/test_socket_helper.rb
index abc177b..2244442 100644
--- a/test/unit/test_socket_helper.rb
+++ b/test/unit/test_socket_helper.rb
@@ -189,7 +189,6 @@ class TestSocketHelper < Test::Unit::TestCase
port = unused_port @test_addr
name = "#@test_addr:#{port}"
sock = bind_listen(name, :reuseport => true)
- cur = sock.getsockopt(Socket::SOL_SOCKET, SO_REUSEPORT).unpack('i')[0]
- assert_equal 1, cur
+ assert sock.getsockopt(Socket::SOL_SOCKET, SO_REUSEPORT).bool
end if defined?(SO_REUSEPORT)
end
The error I get when I test 4.7.0 on debian squeeze (in a VM):
: 1) Error:
: test_reuseport(TestSocketHelper):
: Errno::ENOPROTOOPT: Protocol not available
: /home/ahobson/git/unicorn/test/ruby-1.9.3/lib/unicorn/socket_helper.rb:183:in `setsockopt'
: /home/ahobson/git/unicorn/test/ruby-1.9.3/lib/unicorn/socket_helper.rb:183:in `new_tcp_server'
: /home/ahobson/git/unicorn/test/ruby-1.9.3/lib/unicorn/socket_helper.rb:165:in `bind_listen'
: test/unit/test_socket_helper.rb:191:in `test_reuseport'
:
: 14 tests, 84 assertions, 0 failures, 1 errors, 0 skips
It appears that on linux, SO_REUSEPORT is not necessary to reuse the address/port across processes and may in fact fail.
https://github.com/joyent/libuv/pull/902
I don't know how unicorn should deal with that. I suppose ignoring ENOPROTOOPT if RUBY_PLATFORM =~ /linux/ is an option, but it is certainly not an appealing one.
Thanks,
--drew
_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying
next reply other threads:[~2013-11-04 18:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-04 18:04 Andrew Hobson [this message]
2013-11-04 18:37 ` Unicorn 4.7.0 tests fail on OSX 10.7.5 and debian squeeze Eric Wong
2013-11-04 19:26 ` Andrew Hobson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://yhbt.net/unicorn/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=014F1E10E50D4DA08811BBF10CC70038@gmail.com \
--to=ahobson@gmail.com \
--cc=mongrel-unicorn@rubyforge.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhbt.net/unicorn.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).