Increase all run_and_wait timeouts to at least 10 seconds

This commit is contained in:
Ayaz Salikhov
2025-04-03 21:22:38 +01:00
parent 1473c9bbda
commit f4b31dda77
6 changed files with 15 additions and 15 deletions

View File

@@ -4,4 +4,4 @@ from tests.utils.tracked_container import TrackedContainer
def test_julia(container: TrackedContainer) -> None:
container.run_and_wait(timeout=5, command=["julia", "--version"])
container.run_and_wait(timeout=10, command=["julia", "--version"])

View File

@@ -13,4 +13,4 @@ def test_package_manager(
container: TrackedContainer, package_manager_command: str
) -> None:
"""Test that package managers are installed and run."""
container.run_and_wait(timeout=5, command=[package_manager_command, "--version"])
container.run_and_wait(timeout=10, command=[package_manager_command, "--version"])

View File

@@ -13,7 +13,7 @@ def test_python_version(container: TrackedContainer) -> None:
f"Checking that python major.minor version is {EXPECTED_PYTHON_VERSION}"
)
logs = container.run_and_wait(
timeout=5,
timeout=10,
command=["python", "--version"],
)
python = next(line for line in logs.splitlines() if line.startswith("Python "))
@@ -26,7 +26,7 @@ def test_python_version(container: TrackedContainer) -> None:
def test_python_pinned_version(container: TrackedContainer) -> None:
LOGGER.info(f"Checking that pinned python version is {EXPECTED_PYTHON_VERSION}.*")
logs = container.run_and_wait(
timeout=5,
timeout=10,
command=["cat", "/opt/conda/conda-meta/pinned"],
)
assert f"python {EXPECTED_PYTHON_VERSION}.*" in logs

View File

@@ -11,7 +11,7 @@ THIS_DIR = Path(__file__).parent.resolve()
def test_run_hooks_zero_args(container: TrackedContainer) -> None:
logs = container.run_and_wait(
timeout=5,
timeout=10,
no_failure=False,
command=["bash", "-c", "source /usr/local/bin/run-hooks.sh"],
)
@@ -20,7 +20,7 @@ def test_run_hooks_zero_args(container: TrackedContainer) -> None:
def test_run_hooks_two_args(container: TrackedContainer) -> None:
logs = container.run_and_wait(
timeout=5,
timeout=10,
no_failure=False,
command=[
"bash",
@@ -33,7 +33,7 @@ def test_run_hooks_two_args(container: TrackedContainer) -> None:
def test_run_hooks_missing_dir(container: TrackedContainer) -> None:
logs = container.run_and_wait(
timeout=5,
timeout=10,
no_failure=False,
command=[
"bash",
@@ -46,7 +46,7 @@ def test_run_hooks_missing_dir(container: TrackedContainer) -> None:
def test_run_hooks_dir_is_file(container: TrackedContainer) -> None:
logs = container.run_and_wait(
timeout=5,
timeout=10,
no_failure=False,
command=[
"bash",
@@ -59,7 +59,7 @@ def test_run_hooks_dir_is_file(container: TrackedContainer) -> None:
def test_run_hooks_empty_dir(container: TrackedContainer) -> None:
container.run_and_wait(
timeout=5,
timeout=10,
command=[
"bash",
"-c",
@@ -85,7 +85,7 @@ def run_source_in_dir(
"source /usr/local/bin/run-hooks.sh /home/jovyan/data-copy/" + command_suffix
)
return container.run_and_wait(
timeout=5,
timeout=10,
volumes={host_data_dir: {"bind": cont_data_dir, "mode": "ro"}},
no_failure=no_failure,
command=["bash", "-c", command],

View File

@@ -159,7 +159,7 @@ def test_group_add(container: TrackedContainer) -> None:
additionally verify that setting gid=0 is suggested in a warning.
"""
logs = container.run_and_wait(
timeout=5,
timeout=10,
no_warnings=False,
user="1010:1010",
group_add=["users"], # Ensures write access to /home/jovyan
@@ -180,7 +180,7 @@ def test_set_uid(container: TrackedContainer) -> None:
# This test needs to have tty disabled, the reason is explained here:
# https://github.com/jupyter/docker-stacks/pull/2260#discussion_r2008821257
logs = container.run_and_wait(
timeout=5, no_warnings=False, user="1010", command=["id"], tty=False
timeout=10, no_warnings=False, user="1010", command=["id"], tty=False
)
assert "uid=1010(jovyan) gid=0(root)" in logs
warnings = TrackedContainer.get_warnings(logs)
@@ -191,7 +191,7 @@ def test_set_uid(container: TrackedContainer) -> None:
def test_set_uid_and_nb_user(container: TrackedContainer) -> None:
"""Container should run with the specified uid and NB_USER."""
logs = container.run_and_wait(
timeout=5,
timeout=10,
no_warnings=False,
user="1010",
environment=["NB_USER=kitten"],
@@ -266,7 +266,7 @@ def test_secure_path(container: TrackedContainer, tmp_path: pathlib.Path) -> Non
host_file.chmod(0o755)
logs = container.run_and_wait(
timeout=5,
timeout=10,
user="root",
volumes={host_file: {"bind": "/usr/bin/python", "mode": "ro"}},
command=["python", "--version"],

View File

@@ -4,4 +4,4 @@ from tests.utils.tracked_container import TrackedContainer
def test_julia(container: TrackedContainer) -> None:
container.run_and_wait(timeout=5, command=["julia", "--version"])
container.run_and_wait(timeout=10, command=["julia", "--version"])