mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/net/http/utils.rb (spawn_server): Specify zero for port to
avoid reusing an allocated port. * test/net/http/test_http.rb: Don't specify port here. * test/net/http/test_https.rb: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2127b9cfc7
commit
6895e77ffc
4 changed files with 11 additions and 8 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
Tue Nov 19 21:27:33 2013 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* test/net/http/utils.rb (spawn_server): Specify zero for port to
|
||||||
|
avoid reusing an allocated port.
|
||||||
|
|
||||||
|
* test/net/http/test_http.rb: Don't specify port here.
|
||||||
|
|
||||||
|
* test/net/http/test_https.rb: Ditto.
|
||||||
|
|
||||||
Tue Nov 19 18:52:10 2013 Koichi Sasada <ko1@atdot.net>
|
Tue Nov 19 18:52:10 2013 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
* gc.c (heap_is_swept_object): use heap_page::before_sweep flag.
|
* gc.c (heap_is_swept_object): use heap_page::before_sweep flag.
|
||||||
|
|
|
@ -700,7 +700,6 @@ end
|
||||||
class TestNetHTTP_v1_2 < Test::Unit::TestCase
|
class TestNetHTTP_v1_2 < Test::Unit::TestCase
|
||||||
CONFIG = {
|
CONFIG = {
|
||||||
'host' => '127.0.0.1',
|
'host' => '127.0.0.1',
|
||||||
'port' => 0,
|
|
||||||
'proxy_host' => nil,
|
'proxy_host' => nil,
|
||||||
'proxy_port' => nil,
|
'proxy_port' => nil,
|
||||||
}
|
}
|
||||||
|
@ -718,7 +717,6 @@ end
|
||||||
class TestNetHTTP_v1_2_chunked < Test::Unit::TestCase
|
class TestNetHTTP_v1_2_chunked < Test::Unit::TestCase
|
||||||
CONFIG = {
|
CONFIG = {
|
||||||
'host' => '127.0.0.1',
|
'host' => '127.0.0.1',
|
||||||
'port' => 0,
|
|
||||||
'proxy_host' => nil,
|
'proxy_host' => nil,
|
||||||
'proxy_port' => nil,
|
'proxy_port' => nil,
|
||||||
'chunked' => true,
|
'chunked' => true,
|
||||||
|
@ -749,7 +747,6 @@ end
|
||||||
class TestNetHTTPContinue < Test::Unit::TestCase
|
class TestNetHTTPContinue < Test::Unit::TestCase
|
||||||
CONFIG = {
|
CONFIG = {
|
||||||
'host' => '127.0.0.1',
|
'host' => '127.0.0.1',
|
||||||
'port' => 0,
|
|
||||||
'proxy_host' => nil,
|
'proxy_host' => nil,
|
||||||
'proxy_port' => nil,
|
'proxy_port' => nil,
|
||||||
'chunked' => true,
|
'chunked' => true,
|
||||||
|
@ -834,7 +831,6 @@ end
|
||||||
class TestNetHTTPKeepAlive < Test::Unit::TestCase
|
class TestNetHTTPKeepAlive < Test::Unit::TestCase
|
||||||
CONFIG = {
|
CONFIG = {
|
||||||
'host' => '127.0.0.1',
|
'host' => '127.0.0.1',
|
||||||
'port' => 0,
|
|
||||||
'proxy_host' => nil,
|
'proxy_host' => nil,
|
||||||
'proxy_port' => nil,
|
'proxy_port' => nil,
|
||||||
'RequestTimeout' => 1,
|
'RequestTimeout' => 1,
|
||||||
|
@ -886,7 +882,6 @@ end
|
||||||
class TestNetHTTPLocalBind < Test::Unit::TestCase
|
class TestNetHTTPLocalBind < Test::Unit::TestCase
|
||||||
CONFIG = {
|
CONFIG = {
|
||||||
'host' => 'localhost',
|
'host' => 'localhost',
|
||||||
'port' => 0,
|
|
||||||
'proxy_host' => nil,
|
'proxy_host' => nil,
|
||||||
'proxy_port' => nil,
|
'proxy_port' => nil,
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,6 @@ class TestNetHTTPS < Test::Unit::TestCase
|
||||||
|
|
||||||
CONFIG = {
|
CONFIG = {
|
||||||
'host' => '127.0.0.1',
|
'host' => '127.0.0.1',
|
||||||
'port' => 0,
|
|
||||||
'proxy_host' => nil,
|
'proxy_host' => nil,
|
||||||
'proxy_port' => nil,
|
'proxy_port' => nil,
|
||||||
'ssl_enable' => true,
|
'ssl_enable' => true,
|
||||||
|
|
|
@ -46,7 +46,7 @@ module TestNetHTTPUtils
|
||||||
@config = self.class::CONFIG
|
@config = self.class::CONFIG
|
||||||
server_config = {
|
server_config = {
|
||||||
:BindAddress => config('host'),
|
:BindAddress => config('host'),
|
||||||
:Port => config('port'),
|
:Port => 0,
|
||||||
:Logger => WEBrick::Log.new(NullWriter.new),
|
:Logger => WEBrick::Log.new(NullWriter.new),
|
||||||
:AccessLog => [],
|
:AccessLog => [],
|
||||||
:ShutdownSocketWithoutClose => true,
|
:ShutdownSocketWithoutClose => true,
|
||||||
|
@ -65,7 +65,7 @@ module TestNetHTTPUtils
|
||||||
@server = WEBrick::HTTPServer.new(server_config)
|
@server = WEBrick::HTTPServer.new(server_config)
|
||||||
@server.mount('/', Servlet, config('chunked'))
|
@server.mount('/', Servlet, config('chunked'))
|
||||||
@server.start
|
@server.start
|
||||||
@config['port'] = @server[:Port] if @config['port'] == 0
|
@config['port'] = @server[:Port]
|
||||||
n_try_max = 5
|
n_try_max = 5
|
||||||
begin
|
begin
|
||||||
TCPSocket.open(config('host'), config('port')).close
|
TCPSocket.open(config('host'), config('port')).close
|
||||||
|
|
Loading…
Reference in a new issue