diff --git a/tests/docker/conftest.py b/tests/docker/conftest.py index ce821797c76..088a71b5fe9 100644 --- a/tests/docker/conftest.py +++ b/tests/docker/conftest.py @@ -7,6 +7,10 @@ and exercise it via ``docker run``. They skip when Docker is unavailable Override the image with ``HERMES_TEST_IMAGE`` env var to point at a pre-built image (faster local iteration); otherwise the ``built_image`` fixture builds the repo's Dockerfile once per session. + +Docker tests need longer timeouts than the suite default (30s), so every +test under this directory is granted a 180s default via +``pytest.mark.timeout`` applied at collection time. """ from __future__ import annotations @@ -34,14 +38,17 @@ def _docker_available() -> bool: def pytest_collection_modifyitems(config, items): # noqa: D401 - pytest hook - """Skip every test under tests/docker/ when docker is unavailable.""" - if _docker_available(): - return + """Apply docker-suite policy: timeout bump + skip on missing docker.""" + docker_ok = _docker_available() skip_docker = pytest.mark.skip( reason="Docker not available or daemon not running", ) + extend_timeout = pytest.mark.timeout(180) for item in items: - if "tests/docker/" in str(item.fspath).replace(os.sep, "/"): + if "tests/docker/" not in str(item.fspath).replace(os.sep, "/"): + continue + item.add_marker(extend_timeout) + if not docker_ok: item.add_marker(skip_docker)