From 1a0c3ae8978f6fe83ff1bcfba5cbf24781503ae3 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Mon, 22 Jul 2024 19:22:01 +0100 Subject: [PATCH] Print logs when startup fails --- tests_integration/conftest.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tests_integration/conftest.py b/tests_integration/conftest.py index cbd576174..896defdb3 100644 --- a/tests_integration/conftest.py +++ b/tests_integration/conftest.py @@ -57,12 +57,16 @@ def notebook_service(docker_ip, docker_services): port = docker_services.port_for("aiidalab", 8888) url = f"http://{docker_ip}:{port}" token = os.environ.get("JUPYTER_TOKEN", "testtoken") - docker_services.wait_until_responsive( - # The timeout is very high for this test, because the installation of pseudo libraries. - timeout=180.0, - pause=0.1, - check=lambda: is_responsive(url), - ) + try: + docker_services.wait_until_responsive( + # The timeout is very high for this test, because the installation of pseudo libraries. + timeout=180.0, + pause=0.1, + check=lambda: is_responsive(url), + ) + except Exception as e: + print(docker_compose.execute("logs").decode().strip()) + pytest.exit(e) return url, token