Backport #7320 ยป 0001-backport-r36491-r36491-parallel-builds.diff
test/net/http/test_http.rb | ||
---|---|---|
class TestNetHTTP_v1_2 < Test::Unit::TestCase
|
||
CONFIG = {
|
||
'host' => '127.0.0.1',
|
||
'port' => 10081,
|
||
'port' => 0,
|
||
'proxy_host' => nil,
|
||
'proxy_port' => nil,
|
||
}
|
||
... | ... | |
class TestNetHTTP_v1_2_chunked < Test::Unit::TestCase
|
||
CONFIG = {
|
||
'host' => '127.0.0.1',
|
||
'port' => 10081,
|
||
'port' => 0,
|
||
'proxy_host' => nil,
|
||
'proxy_port' => nil,
|
||
'chunked' => true,
|
||
... | ... | |
class TestNetHTTPContinue < Test::Unit::TestCase
|
||
CONFIG = {
|
||
'host' => '127.0.0.1',
|
||
'port' => 10081,
|
||
'port' => 0,
|
||
'proxy_host' => nil,
|
||
'proxy_port' => nil,
|
||
'chunked' => true,
|
test/net/http/test_https.rb | ||
---|---|---|
CONFIG = {
|
||
'host' => '127.0.0.1',
|
||
'port' => 10082, # different from test_http.rb
|
||
'port' => 0,
|
||
'proxy_host' => nil,
|
||
'proxy_port' => nil,
|
||
'ssl_enable' => true,
|
test/net/http/utils.rb | ||
---|---|---|
end
|
||
def config(key)
|
||
self.class::CONFIG[key]
|
||
@config ||= self.class::CONFIG
|
||
@config[key]
|
||
end
|
||
def logfile
|
||
... | ... | |
end
|
||
def spawn_server
|
||
@config = self.class::CONFIG
|
||
server_config = {
|
||
:BindAddress => config('host'),
|
||
:Port => config('port'),
|
||
... | ... | |
@server = WEBrick::HTTPServer.new(server_config)
|
||
@server.mount('/', Servlet, config('chunked'))
|
||
@server.start
|
||
@config['port'] = @server[:Port] if @config['port'] == 0
|
||
n_try_max = 5
|
||
begin
|
||
TCPSocket.open(config('host'), config('port')).close
|