@@ -90,9 +90,10 @@ async def wait_till_service_healthy(service_name: str, endpoint: URL):
9090 reraise = True ,
9191 ):
9292 with attempt :
93- async with aiohttp .ClientSession (
94- timeout = _ONE_SEC_TIMEOUT
95- ) as session , session .get (endpoint ) as response :
93+ async with (
94+ aiohttp .ClientSession (timeout = _ONE_SEC_TIMEOUT ) as session ,
95+ session .get (endpoint ) as response ,
96+ ):
9697 # NOTE: Health-check endpoint require only a status code 200
9798 # (see e.g. services/web/server/docker/healthcheck.py)
9899 # regardless of the payload content
@@ -164,7 +165,7 @@ def services_endpoint(
164165 return services_endpoint
165166
166167
167- def _wait_for_services_ready (services_endpoint : dict [str , URL ]) -> None :
168+ async def _wait_for_services_ready (services_endpoint : dict [str , URL ]) -> None :
168169 # Compose and log healthcheck url entpoints
169170
170171 health_endpoints = [
@@ -188,14 +189,14 @@ async def _check_all_services_are_healthy():
188189 )
189190
190191 # check ready
191- asyncio . run ( _check_all_services_are_healthy () )
192+ await _check_all_services_are_healthy ()
192193
193194
194195@pytest .fixture
195- def simcore_services_ready (
196+ async def simcore_services_ready (
196197 services_endpoint : dict [str , URL ], monkeypatch : pytest .MonkeyPatch
197198) -> None :
198- _wait_for_services_ready (services_endpoint )
199+ await _wait_for_services_ready (services_endpoint )
199200 # patches environment variables with right host/port per service
200201 for service , endpoint in services_endpoint .items ():
201202 env_prefix = service .upper ().replace ("-" , "_" )
@@ -225,16 +226,15 @@ def _monkeypatch_module(request: pytest.FixtureRequest) -> Iterator[pytest.Monke
225226
226227
227228@pytest .fixture (scope = "module" )
228- def simcore_services_ready_module (
229+ async def simcore_services_ready_module (
229230 services_endpoint : dict [str , URL ], _monkeypatch_module : pytest .MonkeyPatch
230231) -> None :
231232 warnings .warn (
232- "This fixture uses deprecated monkeypatch_module fixture"
233- "Please do NOT use it!" ,
233+ "This fixture uses deprecated monkeypatch_module fixturePlease do NOT use it!" ,
234234 DeprecationWarning ,
235235 stacklevel = 1 ,
236236 )
237- _wait_for_services_ready (services_endpoint )
237+ await _wait_for_services_ready (services_endpoint )
238238 # patches environment variables with right host/port per service
239239 for service , endpoint in services_endpoint .items ():
240240 env_prefix = service .upper ().replace ("-" , "_" )
0 commit comments