class ParallelTests::Test::Runner

def sort_by_runtime(tests, runtimes, options = {})

def sort_by_runtime(tests, runtimes, options = {})
  allowed_missing = options[:allowed_missing] || 1.0
  allowed_missing = tests.size * allowed_missing
  # set know runtime for each test
  tests.sort!
  tests.map! do |test|
    allowed_missing -= 1 unless time = runtimes[test]
    if allowed_missing < 0
      log = options[:runtime_log] || runtime_log
      raise RuntimeLogTooSmallError, "Runtime log file '#{log}' does not contain sufficient data to sort #{tests.size} test files, please update or remove it."
    end
    [test, time]
  end
  puts "Runtime found for #{tests.count(&:last)} of #{tests.size} tests" if options[:verbose]
  set_unknown_runtime tests, options
end