From d5753dbd30c23d4f42e2144bb69df38e7ee3eec8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20=C5=BBy=C5=BAniewski?= Date: Wed, 22 Jan 2025 18:11:30 +0100 Subject: [PATCH] test: wait for uvicorn server to start completly --- tests/unit_tests/test_axon.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/unit_tests/test_axon.py b/tests/unit_tests/test_axon.py index 20fdee4369..d236745875 100644 --- a/tests/unit_tests/test_axon.py +++ b/tests/unit_tests/test_axon.py @@ -16,6 +16,7 @@ # DEALINGS IN THE SOFTWARE. +import asyncio import contextlib import re import threading @@ -816,6 +817,9 @@ async def lifespan(app): server_started.wait() + while not server.started or server_stopped.is_set(): + await asyncio.sleep(1) + assert server.is_running is True async with aiohttp.ClientSession(