class ParallelTests::Test::RuntimeLogger

def unique_log

def unique_log
  with_locked_log do |logfile|
    separator = "\n"
    groups = logfile.read.split(separator).map { |line| line.split(":") }.group_by(&:first)
    lines = groups.map do |file, times|
      time = "%.2f" % times.map(&:last).map(&:to_f).inject(:+)
      "#{file}:#{time}"
    end
    logfile.rewind
    logfile.write(lines.join(separator) + separator)
    logfile.truncate(logfile.pos)
  end
end