Bug #6766

Unable to run tests for different builds due fixed port for Net::HTTPS

Added by Luis Lavena almost 3 years ago. Updated almost 3 years ago.

[ruby-core:46593]
Status:Closed
Priority:Normal
Assignee:Yui NARUSE
ruby -v:ruby 2.0.0dev (2012-07-21 trunk 36487) [x64-mingw32] Backport:

Description

=begin
Hello,

I found that (({test_https.rb})) uses a fixed port number to run its tests, which results in failures due Errno::EADDRINUSE sometimes due clash with another build in my system:

20) Error:
test_verify_none(TestNetHTTPS):
Errno::EADDRINUSE: Only one usage of each socket address (protocol/network address/port) is normally permitted. - bind(2)
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/utils.rb:85:in initialize'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/utils.rb:85:in
new'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/utils.rb:85:in block in create_listeners'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/utils.rb:82:in
each'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/utils.rb:82:in create_listeners'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/ssl.rb:88:in
listen'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/server.rb:70:in initialize'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/httpserver.rb:45:in
initialize'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/net/http/utils.rb:62:in new'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/net/http/utils.rb:62:in
spawn_server'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/net/http/utils.rb:30:in `setup'

21) Error:
test_timeout_during_SSL_handshake(TestNetHTTPS):
Errno::EADDRINUSE: Only one usage of each socket address (protocol/network address/port) is normally permitted. - bind(2)
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/utils.rb:85:in initialize'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/utils.rb:85:in
new'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/utils.rb:85:in block in create_listeners'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/utils.rb:82:in
each'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/utils.rb:82:in create_listeners'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/ssl.rb:88:in
listen'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/server.rb:70:in initialize'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/httpserver.rb:45:in
initialize'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/net/http/utils.rb:62:in new'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/net/http/utils.rb:62:in
spawn_server'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/net/http/utils.rb:30:in `setup'

22) Error:
test_post(TestNetHTTPS):
Errno::EADDRINUSE: Only one usage of each socket address (protocol/network address/port) is normally permitted. - bind(2)
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/utils.rb:85:in initialize'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/utils.rb:85:in
new'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/utils.rb:85:in block in create_listeners'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/utils.rb:82:in
each'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/utils.rb:82:in create_listeners'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/ssl.rb:88:in
listen'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/server.rb:70:in initialize'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/httpserver.rb:45:in
initialize'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/net/http/utils.rb:62:in new'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/net/http/utils.rb:62:in
spawn_server'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/net/http/utils.rb:30:in `setup'

23) Error:
test_identity_verify_failure(TestNetHTTPS):
Errno::EADDRINUSE: Only one usage of each socket address (protocol/network address/port) is normally permitted. - bind(2)
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/utils.rb:85:in initialize'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/utils.rb:85:in
new'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/utils.rb:85:in block in create_listeners'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/utils.rb:82:in
each'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/utils.rb:82:in create_listeners'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/ssl.rb:88:in
listen'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/server.rb:70:in initialize'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/httpserver.rb:45:in
initialize'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/net/http/utils.rb:62:in new'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/net/http/utils.rb:62:in
spawn_server'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/net/http/utils.rb:30:in `setup'

24) Error:
test_get(TestNetHTTPS):
Errno::EADDRINUSE: Only one usage of each socket address (protocol/network address/port) is normally permitted. - bind(2)
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/utils.rb:85:in initialize'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/utils.rb:85:in
new'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/utils.rb:85:in block in create_listeners'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/utils.rb:82:in
each'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/utils.rb:82:in create_listeners'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/ssl.rb:88:in
listen'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/server.rb:70:in initialize'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/httpserver.rb:45:in
initialize'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/net/http/utils.rb:62:in new'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/net/http/utils.rb:62:in
spawn_server'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/net/http/utils.rb:30:in `setup'

25) Error:
test_certificate_verify_failure(TestNetHTTPS):
Errno::EADDRINUSE: Only one usage of each socket address (protocol/network address/port) is normally permitted. - bind(2)
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/utils.rb:85:in initialize'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/utils.rb:85:in
new'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/utils.rb:85:in block in create_listeners'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/utils.rb:82:in
each'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/utils.rb:82:in create_listeners'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/ssl.rb:88:in
listen'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/server.rb:70:in initialize'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/lib/webrick/httpserver.rb:45:in
initialize'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/net/http/utils.rb:62:in new'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/net/http/utils.rb:62:in
spawn_server'
C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/net/http/utils.rb:30:in `setup'

You can see the full log here:

http://ci.rubyinstaller.org/job/test-ruby-trunk-x64/15/console

I would like to suggest port configuration can be randomized based on Process.pid, that way avoiding clashes between two builds being executed at the same time.

Thoughts?
=end


Related issues

Related to Ruby trunk - Bug #6959: Net/HTTPS tests: fixed port usage cause issues on CI Closed 09/02/2012

Associated revisions

Revision 36491
Added by Yui NARUSE almost 3 years ago

Use 0 for webrick's port and get the actual port. [Bug #6766]

Revision 36491
Added by Yui NARUSE almost 3 years ago

Use 0 for webrick's port and get the actual port. [Bug #6766]

Revision 36877
Added by Yui NARUSE over 2 years ago

Use 0 as port like #6766 [Bug #6959]

Revision 36877
Added by Yui NARUSE over 2 years ago

Use 0 as port like #6766 [Bug #6959]

History

#1 Updated by Yui NARUSE almost 3 years ago

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

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


Use 0 for webrick's port and get the actual port. [Bug #6766]

Also available in: Atom PDF