Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Tests: Connection refused - connect(2) #274

bkabrda opened this Issue Nov 25, 2011 · 1 comment


None yet
2 participants

bkabrda commented Nov 25, 2011

Hi, I was running tests of rack and I got this error:

[2011-11-25 10:48:31] INFO WEBrick 1.3.1
[2011-11-25 10:48:31] INFO ruby 1.9.3 (2011-10-30) [x86_64-linux]
[2011-11-25 10:48:31] INFO WEBrick::HTTPServer#start: pid=13521 port=44372

Errno::ECONNREFUSED: Connection refused - connect(2)
/usr/share/ruby/net/http.rb:762:in initialize': Rack::Server - should run a server /usr/share/ruby/net/http.rb:762:inopen'
/usr/share/ruby/net/http.rb:762:in block in connect' /usr/share/ruby/timeout.rb:54:intimeout'
/usr/share/ruby/timeout.rb:99:in timeout' /usr/share/ruby/net/http.rb:762:inconnect'
/usr/share/ruby/net/http.rb:755:in do_start' /usr/share/ruby/net/http.rb:744:instart'
/usr/share/ruby/open-uri.rb:306:in open_http' /usr/share/ruby/open-uri.rb:775:inbuffer_open'
/usr/share/ruby/open-uri.rb:203:in block in open_loop' /usr/share/ruby/open-uri.rb:201:incatch'
/usr/share/ruby/open-uri.rb:201:in open_loop' /usr/share/ruby/open-uri.rb:146:inopen_uri'
/usr/share/ruby/open-uri.rb:677:in open' /usr/share/ruby/open-uri.rb:33:inopen'
test/spec_server.rb:66:in block (2 levels) in <top (required)>' test/spec_server.rb:52:inblock in <top (required)>'
test/spec_server.rb:7:in `<top (required)>'

I think its connected to the way you synchronize the threads:
until t.status == 'sleep'; t.join(0.01) end
On a faster machine, I think there can be a problem that thread goes asleep and the server is still not fully loaded. If you put sleep(1) after this line or if you extend the join limit to for example 0.1, everything works fine.
Am I missing something or can this really be a test issue on faster systems?

Thank you,
Bohuslav Kabrda.

@josh josh closed this Nov 30, 2011

bkabrda commented Dec 19, 2011

Care to elaborate why you closed this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment