Bug #6959

Net/HTTPS tests: fixed port usage cause issues on CI

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

[ruby-core:47387]
Status:Closed
Priority:Normal
Assignee:Yui NARUSE
ruby -v:ruby 2.0.0dev (2012-09-01 trunk 36875) [x64-mingw32] Backport:

Description

=begin
Hello,

RubyInstaller's CI worker compiles and run tests for both x86 and x64 builds from trunk.

Sometimes, these builds are run in parallel and causing random (({Errno::EADDRINUSE})):

8) 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/ruby-trunk-x64-build/lib/webrick/utils.rb:85:in initialize'
C:/Users/Worker/Jenkins/workspace/ruby-trunk-x64-build/lib/webrick/utils.rb:85:in
new'
C:/Users/Worker/Jenkins/workspace/ruby-trunk-x64-build/lib/webrick/utils.rb:85:in block in create_listeners'
C:/Users/Worker/Jenkins/workspace/ruby-trunk-x64-build/lib/webrick/utils.rb:82:in
each'
C:/Users/Worker/Jenkins/workspace/ruby-trunk-x64-build/lib/webrick/utils.rb:82:in create_listeners'
C:/Users/Worker/Jenkins/workspace/ruby-trunk-x64-build/lib/webrick/ssl.rb:88:in
listen'
C:/Users/Worker/Jenkins/workspace/ruby-trunk-x64-build/lib/webrick/server.rb:70:in initialize'
C:/Users/Worker/Jenkins/workspace/ruby-trunk-x64-build/lib/webrick/httpserver.rb:45:in
initialize'
C:/Users/Worker/Jenkins/workspace/ruby-trunk-x64-build/test/net/http/utils.rb:64:in new'
C:/Users/Worker/Jenkins/workspace/ruby-trunk-x64-build/test/net/http/utils.rb:64:in
spawn_server'
C:/Users/Worker/Jenkins/workspace/ruby-trunk-x64-build/test/net/http/utils.rb:31:in `setup'

Full output here:

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

http://ci.rubyinstaller.org/job/ruby-trunk-x86-test-all/23/console

Back in #6766, Yui NARUSE used '0' as WEBrick port to select one randomly, but appears that is not working as expected.

As you can see, those random failures are a problem when trying to determine a real failure.

Perhaps the port can be randomized with (({Process.pid})) as base? That way chances of same por for different process are minimal.

Thank you.
=end


Related issues

Related to Ruby trunk - Bug #6766: Unable to run tests for different builds due fixed port for Net::HTTPS Closed 07/22/2012

Associated revisions

Revision 36877
Added by Yui NARUSE almost 3 years ago

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

Revision 36877
Added by Yui NARUSE almost 3 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 r36877.
Luis, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


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

Also available in: Atom PDF