You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: sleep_helper.rb
    path of file: ./repos/good_job/spec/support
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module SleepHelper
  TooSlowError = Class.new(StandardError)

  def wait_until(max: 5.seconds, increments_of: 0.1.s
    
  def wait_until(max: 5.seconds, increments_of: 0.1.seconds, &block)
    start_time = Time.current

    loop do
      failed = false

      begin
        GoodJob::BaseRecord.uncached(&block)
      rescue RSpec::Expectations::ExpectationNotMetError
        failed = true
        raise if Time.current > start_time + max
      end
      break unless failed

      sleep increments_of
    end