Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
pcrespov committed Aug 21, 2024
1 parent f2b2585 commit 328145a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/pytest-simcore/src/pytest_simcore/docker_swarm.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def _is_docker_swarm_init(docker_client: docker.client.DockerClient) -> bool:
@retry(
wait=wait_fixed(1),
stop=stop_after_delay(8 * MINUTE),
before_sleep=before_sleep_log(log, logging.WARNING),
before_sleep=before_sleep_log(log, logging.INFO),
reraise=True,
)
def assert_service_is_running(service) -> None:
Expand Down Expand Up @@ -372,7 +372,7 @@ async def _check_all_services_are_running():
for attempt in Retrying(
wait=wait_fixed(2),
stop=stop_after_delay(3 * MINUTE),
before_sleep=before_sleep_log(log, logging.WARNING),
before_sleep=before_sleep_log(log, logging.INFO),
reraise=True,
):
with attempt:
Expand Down
12 changes: 9 additions & 3 deletions packages/pytest-simcore/src/pytest_simcore/simcore_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import logging
import warnings
from dataclasses import dataclass
from io import StringIO
from typing import Iterator

import aiohttp
Expand Down Expand Up @@ -151,9 +152,14 @@ def _wait_for_services_ready(services_endpoint: dict[str, URL]) -> None:
for service_name, endpoint in services_endpoint.items()
]

print("Composing health-check endpoints for relevant stack's services:")
for h in health_endpoints:
print(f" - {h.name} -> {h.url}")
with StringIO() as buffer:
print(
"Composing health-check endpoints for relevant stack's services:",
file=buffer,
)
for h in health_endpoints:
print(f" - {h.name} -> {h.url}", file=buffer)
log.info(buffer.getvalue())

async def _check_all_services_are_healthy():
await asyncio.gather(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def _create() -> str:


@pytest.fixture
def socketio_url_factory(client) -> Callable[[TestClient | None], str]:
def socketio_url_factory(client: TestClient) -> Callable[[TestClient | None], str]:
def _create(client_override: TestClient | None = None) -> str:
SOCKET_IO_PATH = "/socket.io/"
return str((client_override or client).make_url(SOCKET_IO_PATH))
Expand Down

0 comments on commit 328145a

Please sign in to comment.