From e6d00ad17f94d0e06ab147a19caf91ae9db873ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20=C5=BBy=C5=BAniewski?= Date: Mon, 3 Feb 2025 12:40:28 +0100 Subject: [PATCH] tests: add timeouts --- tests/unit_tests/test_axon.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/unit_tests/test_axon.py b/tests/unit_tests/test_axon.py index 47533a2487..88c6bb2d7d 100644 --- a/tests/unit_tests/test_axon.py +++ b/tests/unit_tests/test_axon.py @@ -815,10 +815,11 @@ async def lifespan(app): ) server.start() - server_started.wait() + server_started.wait(3.0) - while not (server.started or server_stopped.is_set()): - await asyncio.sleep(1) + async with asyncio.timeout(3.0): + while not (server.started or server_stopped.is_set()): + await asyncio.sleep(1.0) assert server.is_running is True