def test_agent_shutdown(): # Get the application connected to the actual 8T endpoint app = Application('Python Agent Test (Infinite Tracing)') app.connect_to_data_collector(None) rpc = app._active_session._rpc # Store references to the original rpc and threads assert rpc.response_processing_thread.is_alive() app.internal_agent_shutdown(restart=False) assert not rpc.response_processing_thread.is_alive() assert not rpc.channel
def app(): app = Application('Python Agent Test (Infinite Tracing)') yield app # Calling internal_agent_shutdown on an application that is already closed # will raise an exception. active_session = app._active_session try: app.internal_agent_shutdown(restart=False) except: pass if active_session: assert not active_session._rpc.response_processing_thread.is_alive() assert not active_session._rpc.channel