Bug #6766
closedUnable to run tests for different builds due fixed port for Net::HTTPS
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:
-
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:ininitialize' 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:inblock 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:increate_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:ininitialize' 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:innew' 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' -
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:ininitialize' 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:inblock 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:increate_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:ininitialize' 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:innew' 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' -
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:ininitialize' 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:inblock 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:increate_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:ininitialize' 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:innew' 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' -
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:ininitialize' 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:inblock 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:increate_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:ininitialize' 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:innew' 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' -
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:ininitialize' 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:inblock 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:increate_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:ininitialize' 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:innew' 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' -
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:ininitialize' 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:inblock 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:increate_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:ininitialize' 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:innew' 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