Skip to content

Commit

Permalink
🧪 Debug log assertion test failing sporadically
Browse files Browse the repository at this point in the history
Filter the logs being read by module name, and add short sleep to allow log handlers to flush

Signed-off-by: ff137 <[email protected]>
  • Loading branch information
ff137 committed Nov 7, 2024
1 parent d17932a commit 4c7353f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion acapy_agent/core/tests/test_conductor.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import asyncio
from unittest import IsolatedAsyncioTestCase

import pytest
Expand Down Expand Up @@ -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 = {
Expand All @@ -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)
Expand Down

0 comments on commit 4c7353f

Please sign in to comment.