diff options
Diffstat (limited to 'test/net/http/utils.rb')
-rw-r--r-- | test/net/http/utils.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/net/http/utils.rb b/test/net/http/utils.rb index 02e99d45fb..592bbd21cc 100644 --- a/test/net/http/utils.rb +++ b/test/net/http/utils.rb @@ -46,7 +46,7 @@ module TestNetHTTPUtils @config = self.class::CONFIG server_config = { :BindAddress => config('host'), - :Port => config('port'), + :Port => 0, :Logger => WEBrick::Log.new(NullWriter.new), :AccessLog => [], :ShutdownSocketWithoutClose => true, @@ -65,7 +65,7 @@ module TestNetHTTPUtils @server = WEBrick::HTTPServer.new(server_config) @server.mount('/', Servlet, config('chunked')) @server.start - @config['port'] = @server[:Port] if @config['port'] == 0 + @config['port'] = @server[:Port] n_try_max = 5 begin TCPSocket.open(config('host'), config('port')).close |