Project

General

Profile

Actions

Bug #6766

closed

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

Added by luislavena (Luis Lavena) almost 10 years ago. Updated almost 10 years ago.

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

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:

  1. 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'

  2. 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'

  3. 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'

  4. 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'

  5. 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'

  6. 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 1 (0 open1 closed)

Related to Ruby master - Bug #6959: Net/HTTPS tests: fixed port usage cause issues on CIClosednaruse (Yui NARUSE)09/02/2012Actions
Actions #1

Updated by naruse (Yui NARUSE) almost 10 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]

Actions

Also available in: Atom PDF