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