From 60d8e07dedd50ad79e9bf95c0449f0846dbdc762 Mon Sep 17 00:00:00 2001 From: Ben Date: Thu, 21 May 2026 14:03:13 +1000 Subject: [PATCH] test(docker): apply 180s timeout to docker harness tests The agent-test suite default is 30s; docker test_no_args (the dashboard spin-up, the container restart) routinely take 60-90s. Without this they intermittently fail in CI with TimeoutError. --- tests/docker/conftest.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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)