Project

General

Profile

Backport #7320 ยป 0001-backport-r36491-r36491-parallel-builds.diff

luislavena (Luis Lavena), 11/10/2012 03:43 AM

View differences:

test/net/http/test_http.rb
426 426
class TestNetHTTP_v1_2 < Test::Unit::TestCase
427 427
  CONFIG = {
428 428
    'host' => '127.0.0.1',
429
    'port' => 10081,
429
    'port' => 0,
430 430
    'proxy_host' => nil,
431 431
    'proxy_port' => nil,
432 432
  }
......
444 444
class TestNetHTTP_v1_2_chunked < Test::Unit::TestCase
445 445
  CONFIG = {
446 446
    'host' => '127.0.0.1',
447
    'port' => 10081,
447
    'port' => 0,
448 448
    'proxy_host' => nil,
449 449
    'proxy_port' => nil,
450 450
    'chunked' => true,
......
476 476
class TestNetHTTPContinue < Test::Unit::TestCase
477 477
  CONFIG = {
478 478
    'host' => '127.0.0.1',
479
    'port' => 10081,
479
    'port' => 0,
480 480
    'proxy_host' => nil,
481 481
    'proxy_port' => nil,
482 482
    'chunked' => true,
test/net/http/test_https.rb
24 24

  
25 25
  CONFIG = {
26 26
    'host' => '127.0.0.1',
27
    'port' => 10082, # different from test_http.rb
27
    'port' => 0,
28 28
    'proxy_host' => nil,
29 29
    'proxy_port' => nil,
30 30
    'ssl_enable' => true,
test/net/http/utils.rb
19 19
  end
20 20

  
21 21
  def config(key)
22
    self.class::CONFIG[key]
22
    @config ||= self.class::CONFIG
23
    @config[key]
23 24
  end
24 25

  
25 26
  def logfile
......
42 43
  end
43 44

  
44 45
  def spawn_server
46
    @config = self.class::CONFIG
45 47
    server_config = {
46 48
      :BindAddress => config('host'),
47 49
      :Port => config('port'),
......
61 63
    @server = WEBrick::HTTPServer.new(server_config)
62 64
    @server.mount('/', Servlet, config('chunked'))
63 65
    @server.start
66
    @config['port'] = @server[:Port] if @config['port'] == 0
64 67
    n_try_max = 5
65 68
    begin
66 69
      TCPSocket.open(config('host'), config('port')).close