From 4c7353fed1fcdf11f007aa12904382145016b869 Mon Sep 17 00:00:00 2001 From: ff137 Date: Thu, 7 Nov 2024 17:31:20 +0200 Subject: [PATCH] :test_tube: Debug log assertion test failing sporadically Filter the logs being read by module name, and add short sleep to allow log handlers to flush Signed-off-by: ff137 --- acapy_agent/core/tests/test_conductor.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/acapy_agent/core/tests/test_conductor.py b/acapy_agent/core/tests/test_conductor.py index 5cc61c9e2e..2dc5fbaa73 100644 --- a/acapy_agent/core/tests/test_conductor.py +++ b/acapy_agent/core/tests/test_conductor.py @@ -1,3 +1,4 @@ +import asyncio from unittest import IsolatedAsyncioTestCase import pytest @@ -1208,7 +1209,9 @@ async def test_print_invite_connection(self): test_profile, DIDInfo("did", "verkey", metadata={}, method=SOV, key_type=ED25519), ), - ), self.assertLogs(level="INFO") as captured, mock.patch.object( + ), self.assertLogs( + "acapy_agent.core.conductor", level="INFO" + ) as captured, mock.patch.object( test_module, "OutboundTransportManager", autospec=True ) as mock_outbound_mgr: mock_outbound_mgr.return_value.registered_transports = { @@ -1218,6 +1221,7 @@ async def test_print_invite_connection(self): await conductor.start() await conductor.stop() + await asyncio.sleep(0.1) # Allow log handlers to flush value = captured.output assert any("http://localhost?oob=" in msg for msg in value) assert any("http://localhost?c_i=" in msg for msg in value)