mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-07 10:04:03 +00:00
Increase all run_and_wait timeouts to at least 10 seconds
This commit is contained in:
@@ -4,4 +4,4 @@ from tests.utils.tracked_container import TrackedContainer
|
|||||||
|
|
||||||
|
|
||||||
def test_julia(container: TrackedContainer) -> None:
|
def test_julia(container: TrackedContainer) -> None:
|
||||||
container.run_and_wait(timeout=5, command=["julia", "--version"])
|
container.run_and_wait(timeout=10, command=["julia", "--version"])
|
||||||
|
@@ -13,4 +13,4 @@ def test_package_manager(
|
|||||||
container: TrackedContainer, package_manager_command: str
|
container: TrackedContainer, package_manager_command: str
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test that package managers are installed and run."""
|
"""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"])
|
||||||
|
@@ -13,7 +13,7 @@ def test_python_version(container: TrackedContainer) -> None:
|
|||||||
f"Checking that python major.minor version is {EXPECTED_PYTHON_VERSION}"
|
f"Checking that python major.minor version is {EXPECTED_PYTHON_VERSION}"
|
||||||
)
|
)
|
||||||
logs = container.run_and_wait(
|
logs = container.run_and_wait(
|
||||||
timeout=5,
|
timeout=10,
|
||||||
command=["python", "--version"],
|
command=["python", "--version"],
|
||||||
)
|
)
|
||||||
python = next(line for line in logs.splitlines() if line.startswith("Python "))
|
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:
|
def test_python_pinned_version(container: TrackedContainer) -> None:
|
||||||
LOGGER.info(f"Checking that pinned python version is {EXPECTED_PYTHON_VERSION}.*")
|
LOGGER.info(f"Checking that pinned python version is {EXPECTED_PYTHON_VERSION}.*")
|
||||||
logs = container.run_and_wait(
|
logs = container.run_and_wait(
|
||||||
timeout=5,
|
timeout=10,
|
||||||
command=["cat", "/opt/conda/conda-meta/pinned"],
|
command=["cat", "/opt/conda/conda-meta/pinned"],
|
||||||
)
|
)
|
||||||
assert f"python {EXPECTED_PYTHON_VERSION}.*" in logs
|
assert f"python {EXPECTED_PYTHON_VERSION}.*" in logs
|
||||||
|
@@ -11,7 +11,7 @@ THIS_DIR = Path(__file__).parent.resolve()
|
|||||||
|
|
||||||
def test_run_hooks_zero_args(container: TrackedContainer) -> None:
|
def test_run_hooks_zero_args(container: TrackedContainer) -> None:
|
||||||
logs = container.run_and_wait(
|
logs = container.run_and_wait(
|
||||||
timeout=5,
|
timeout=10,
|
||||||
no_failure=False,
|
no_failure=False,
|
||||||
command=["bash", "-c", "source /usr/local/bin/run-hooks.sh"],
|
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:
|
def test_run_hooks_two_args(container: TrackedContainer) -> None:
|
||||||
logs = container.run_and_wait(
|
logs = container.run_and_wait(
|
||||||
timeout=5,
|
timeout=10,
|
||||||
no_failure=False,
|
no_failure=False,
|
||||||
command=[
|
command=[
|
||||||
"bash",
|
"bash",
|
||||||
@@ -33,7 +33,7 @@ def test_run_hooks_two_args(container: TrackedContainer) -> None:
|
|||||||
|
|
||||||
def test_run_hooks_missing_dir(container: TrackedContainer) -> None:
|
def test_run_hooks_missing_dir(container: TrackedContainer) -> None:
|
||||||
logs = container.run_and_wait(
|
logs = container.run_and_wait(
|
||||||
timeout=5,
|
timeout=10,
|
||||||
no_failure=False,
|
no_failure=False,
|
||||||
command=[
|
command=[
|
||||||
"bash",
|
"bash",
|
||||||
@@ -46,7 +46,7 @@ def test_run_hooks_missing_dir(container: TrackedContainer) -> None:
|
|||||||
|
|
||||||
def test_run_hooks_dir_is_file(container: TrackedContainer) -> None:
|
def test_run_hooks_dir_is_file(container: TrackedContainer) -> None:
|
||||||
logs = container.run_and_wait(
|
logs = container.run_and_wait(
|
||||||
timeout=5,
|
timeout=10,
|
||||||
no_failure=False,
|
no_failure=False,
|
||||||
command=[
|
command=[
|
||||||
"bash",
|
"bash",
|
||||||
@@ -59,7 +59,7 @@ def test_run_hooks_dir_is_file(container: TrackedContainer) -> None:
|
|||||||
|
|
||||||
def test_run_hooks_empty_dir(container: TrackedContainer) -> None:
|
def test_run_hooks_empty_dir(container: TrackedContainer) -> None:
|
||||||
container.run_and_wait(
|
container.run_and_wait(
|
||||||
timeout=5,
|
timeout=10,
|
||||||
command=[
|
command=[
|
||||||
"bash",
|
"bash",
|
||||||
"-c",
|
"-c",
|
||||||
@@ -85,7 +85,7 @@ def run_source_in_dir(
|
|||||||
"source /usr/local/bin/run-hooks.sh /home/jovyan/data-copy/" + command_suffix
|
"source /usr/local/bin/run-hooks.sh /home/jovyan/data-copy/" + command_suffix
|
||||||
)
|
)
|
||||||
return container.run_and_wait(
|
return container.run_and_wait(
|
||||||
timeout=5,
|
timeout=10,
|
||||||
volumes={host_data_dir: {"bind": cont_data_dir, "mode": "ro"}},
|
volumes={host_data_dir: {"bind": cont_data_dir, "mode": "ro"}},
|
||||||
no_failure=no_failure,
|
no_failure=no_failure,
|
||||||
command=["bash", "-c", command],
|
command=["bash", "-c", command],
|
||||||
|
@@ -159,7 +159,7 @@ def test_group_add(container: TrackedContainer) -> None:
|
|||||||
additionally verify that setting gid=0 is suggested in a warning.
|
additionally verify that setting gid=0 is suggested in a warning.
|
||||||
"""
|
"""
|
||||||
logs = container.run_and_wait(
|
logs = container.run_and_wait(
|
||||||
timeout=5,
|
timeout=10,
|
||||||
no_warnings=False,
|
no_warnings=False,
|
||||||
user="1010:1010",
|
user="1010:1010",
|
||||||
group_add=["users"], # Ensures write access to /home/jovyan
|
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:
|
# This test needs to have tty disabled, the reason is explained here:
|
||||||
# https://github.com/jupyter/docker-stacks/pull/2260#discussion_r2008821257
|
# https://github.com/jupyter/docker-stacks/pull/2260#discussion_r2008821257
|
||||||
logs = container.run_and_wait(
|
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
|
assert "uid=1010(jovyan) gid=0(root)" in logs
|
||||||
warnings = TrackedContainer.get_warnings(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:
|
def test_set_uid_and_nb_user(container: TrackedContainer) -> None:
|
||||||
"""Container should run with the specified uid and NB_USER."""
|
"""Container should run with the specified uid and NB_USER."""
|
||||||
logs = container.run_and_wait(
|
logs = container.run_and_wait(
|
||||||
timeout=5,
|
timeout=10,
|
||||||
no_warnings=False,
|
no_warnings=False,
|
||||||
user="1010",
|
user="1010",
|
||||||
environment=["NB_USER=kitten"],
|
environment=["NB_USER=kitten"],
|
||||||
@@ -266,7 +266,7 @@ def test_secure_path(container: TrackedContainer, tmp_path: pathlib.Path) -> Non
|
|||||||
host_file.chmod(0o755)
|
host_file.chmod(0o755)
|
||||||
|
|
||||||
logs = container.run_and_wait(
|
logs = container.run_and_wait(
|
||||||
timeout=5,
|
timeout=10,
|
||||||
user="root",
|
user="root",
|
||||||
volumes={host_file: {"bind": "/usr/bin/python", "mode": "ro"}},
|
volumes={host_file: {"bind": "/usr/bin/python", "mode": "ro"}},
|
||||||
command=["python", "--version"],
|
command=["python", "--version"],
|
||||||
|
@@ -4,4 +4,4 @@ from tests.utils.tracked_container import TrackedContainer
|
|||||||
|
|
||||||
|
|
||||||
def test_julia(container: TrackedContainer) -> None:
|
def test_julia(container: TrackedContainer) -> None:
|
||||||
container.run_and_wait(timeout=5, command=["julia", "--version"])
|
container.run_and_wait(timeout=10, command=["julia", "--version"])
|
||||||
|
Reference in New Issue
Block a user