<commit_before>require 'childprocess'
require 'timeout'
require 'httparty'

server = ChildProcess.build('rackup', '--port', '9999')
server.start
sleep(5)

at_exit do
  server.stop
end<commit_msg>Wait for the app to start when running cucumber tests<commit_after>require 'childprocess'
require 'timeout'
require 'httparty'

server = ChildProcess.build('rackup', '--port', '9999')
server.start
#sleep(5)


Timeout.timeout(3) do
  loop do
    begin
      HTTParty.get('http://localhost:9999')
      break
    rescue Errno::ECONNREFUSED =>
        try_again
      sleep 0.1
    end
  end
end

at_exit do
  server.stop
end
{'fraction_non_alphanumeric': 0.1166936790923825, 'fraction_numerical': 0.027552674230145867, 'mean_word_length': 3.944, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '2607270', 'n_tokens_mistral': 220, 'n_tokens_neox': 206, 'n_words': 55}