From 8d01f6b34ba90abb2597d9d46d151a7b7fc464ab Mon Sep 17 00:00:00 2001 From: ckunki Date: Wed, 27 Mar 2024 17:32:18 +0100 Subject: [PATCH] Increase timeout for notebook tests to wait for socket access [run-notebook-tests] --- test/docker/container.py | 5 ++++- .../test_notebooks_in_dss_docker_image.py | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/test/docker/container.py b/test/docker/container.py index ce184c88..354de2fd 100644 --- a/test/docker/container.py +++ b/test/docker/container.py @@ -86,7 +86,10 @@ def wait_for( DOCKER_SOCKET_CONTAINER = "/var/run/docker.sock" -def wait_for_socket_access(container: Container): +def wait_for_socket_access( + container: Container, + timeout: timedelta = timedelta(seconds=5), +): wait_for( container, f"entrypoint.py: Enabled access to {DOCKER_SOCKET_CONTAINER}", diff --git a/test/notebook_test_runner/test_notebooks_in_dss_docker_image.py b/test/notebook_test_runner/test_notebooks_in_dss_docker_image.py index 4a9f1f0c..9ac001e3 100644 --- a/test/notebook_test_runner/test_notebooks_in_dss_docker_image.py +++ b/test/notebook_test_runner/test_notebooks_in_dss_docker_image.py @@ -4,6 +4,7 @@ import time from inspect import cleandoc from pathlib import Path +from datetime import timedelta import pytest @@ -66,7 +67,7 @@ def notebook_test_container(request, notebook_test_image): @pytest.fixture() def notebook_test_container_with_log(notebook_test_container): - wait_for_socket_access(notebook_test_container) + wait_for_socket_access(notebook_test_container, timeout=timedelta(seconds=60)) logs = notebook_test_container.logs().decode("utf-8").strip() print(f"Container Logs: {logs or '(empty)'}", flush=True) yield notebook_test_container