<commit_before>require 'socket'
require 'posix/spawn'

module TestServer
  extend self

  def host
    'localhost'
  end

  def port
    9292
  end

  def uri
    URI.parse("http://#{host}:#{port}")
  end

  def pid
    @pid
  end

  def start
    @pid = POSIX::Spawn.spawn("passenger start --port #{port}", :out => 'test_server.output')
    sleep(5)
  end

  def stop
    Process.kill("TERM", pid) if pid
  end

  protected

  def find_available_port
    server = TCPServer.new('127.0.0.1', '9292')
    server.addr[1]
  ensure
    server.close if server
  end
end
<commit_msg>Try to make it work on travis<commit_after>require 'socket'
require 'posix/spawn'

module TestServer
  extend self

  def host
    'localhost'
  end

  def port
    9299
  end

  def uri
    URI.parse("http://#{host}:#{port}")
  end

  def pid
    @pid
  end

  def start
    @pid = POSIX::Spawn.spawn("passenger start --port #{port}", out: 'test_server.output')
    sleep 10
  end

  def stop
    Process.kill("TERM", pid) if pid
  end

end

{'fraction_non_alphanumeric': 0.1197252208047105, 'fraction_numerical': 0.021589793915603533, 'mean_word_length': 2.6559139784946235, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6245807', 'n_tokens_mistral': 391, 'n_tokens_neox': 373, 'n_words': 105}