mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-17 15:02:57 +00:00
Adjust sleep times (#2080)
* Adjust sleep times * Update test_start_container.py * Update test_healthcheck.py * Update pluto_check.py
This commit is contained in:
@@ -68,7 +68,7 @@ RUN fix-permissions /etc/jupyter/
|
||||
# HEALTHCHECK documentation: https://docs.docker.com/engine/reference/builder/#healthcheck
|
||||
# This healtcheck works well for `lab`, `notebook`, `nbclassic`, `server`, and `retro` jupyter commands
|
||||
# https://github.com/jupyter/docker-stacks/issues/915#issuecomment-1068528799
|
||||
HEALTHCHECK --interval=5s --timeout=3s --start-period=5s --retries=3 \
|
||||
HEALTHCHECK --interval=3s --timeout=1s --start-period=3s --retries=3 \
|
||||
CMD /etc/jupyter/docker_healthcheck.py || exit 1
|
||||
|
||||
# Switch back to jovyan to avoid accidental container runs as root
|
||||
|
@@ -67,13 +67,11 @@ def test_healthy(
|
||||
user=user,
|
||||
)
|
||||
|
||||
# sleeping some time to let the server start
|
||||
time_spent = 0.0
|
||||
wait_time = 0.1
|
||||
time_limit = 15
|
||||
while time_spent < time_limit:
|
||||
time.sleep(wait_time)
|
||||
time_spent += wait_time
|
||||
# giving some time to let the server start
|
||||
finish_time = time.time() + 10
|
||||
sleep_time = 0.1
|
||||
while time.time() < finish_time:
|
||||
time.sleep(sleep_time)
|
||||
if get_health(running_container) == "healthy":
|
||||
return
|
||||
|
||||
@@ -114,13 +112,11 @@ def test_healthy_with_proxy(
|
||||
user=user,
|
||||
)
|
||||
|
||||
# sleeping some time to let the server start
|
||||
time_spent = 0.0
|
||||
wait_time = 0.1
|
||||
time_limit = 15
|
||||
while time_spent < time_limit:
|
||||
time.sleep(wait_time)
|
||||
time_spent += wait_time
|
||||
# giving some time to let the server start
|
||||
finish_time = time.time() + 10
|
||||
sleep_time = 0.1
|
||||
while time.time() < finish_time:
|
||||
time.sleep(sleep_time)
|
||||
if get_health(running_container) == "healthy":
|
||||
return
|
||||
|
||||
@@ -152,13 +148,11 @@ def test_not_healthy(
|
||||
command=cmd,
|
||||
)
|
||||
|
||||
# sleeping some time to let the server start
|
||||
time_spent = 0.0
|
||||
wait_time = 0.1
|
||||
time_limit = 15
|
||||
while time_spent < time_limit:
|
||||
time.sleep(wait_time)
|
||||
time_spent += wait_time
|
||||
# giving some time to let the server start
|
||||
finish_time = time.time() + 5
|
||||
sleep_time = 0.1
|
||||
while time.time() < finish_time:
|
||||
time.sleep(sleep_time)
|
||||
if get_health(running_container) == "healthy":
|
||||
raise RuntimeError("Container should not be healthy for this testcase")
|
||||
|
||||
|
@@ -24,7 +24,7 @@ def check_pluto_proxy(
|
||||
ports={"8888/tcp": host_port},
|
||||
)
|
||||
# Give the server a bit of time to start
|
||||
time.sleep(3)
|
||||
time.sleep(2)
|
||||
resp = http_client.get(f"http://localhost:{host_port}/pluto?token={token}")
|
||||
resp.raise_for_status()
|
||||
assert "Pluto.jl notebooks" in resp.text, "Pluto.jl text not found in /pluto page"
|
||||
|
Reference in New Issue
Block a user