We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f748b18 commit 01a7d5fCopy full SHA for 01a7d5f
tests/test_a01_api.py
@@ -37,6 +37,9 @@
37
from .conftest import QUEUE_TIMEOUT
38
39
40
+RELEASE_TIMEOUT = 2
41
+
42
43
@pytest.fixture(name="a01_mqtt_client")
44
async def a01_mqtt_client_fixture(
45
mock_create_connection: None, mock_select: None
@@ -59,9 +62,11 @@ async def a01_mqtt_client_fixture(
59
62
try:
60
63
yield client
61
64
finally:
- if not client.is_connected():
65
+ # Cleanup is best effort to reduce number of active threads
66
+ if client.is_connected():
67
- await client.async_release()
68
+ async with asyncio.timeout(RELEASE_TIMEOUT):
69
+ await client.async_release()
70
except Exception:
71
pass
72
0 commit comments