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: agent_test.rb
    path of file: ./repos/newrelic-ruby-agent/infinite_tracing/test/infinite_tracing/agent_integrations
    
    the code of the file until where you have to start completion: # This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
# frozen_string_literal: true

require_relative '../../test_helper'

module NewRelic
  module Agent
    module I
    
        def test_agent_restart_closes_infinite_tracing
          NewRelic::Agent::Agent.any_instance.expects('close_infinite_tracer')
          NewRelic::Agent::Agent.any_instance.stubs(:sleep).returns(0)
          inf_tracer = NewRelic::Agent.agent.infinite_tracer

          assert NewRelic::Agent.agent.instance_variable_get(:@infinite_tracer_thread), 'Expected infinite tracer thread to not be nil'
          NewRelic::Agent.agent.handle_force_restart(StandardError.new('test'))
        end