Files
docker-stacks/tests/pluto_check.py
Ayaz Salikhov d57bf9590d Adjust sleep times (#2080)
* Adjust sleep times

* Update test_start_container.py

* Update test_healthcheck.py

* Update pluto_check.py
2024-01-17 02:11:44 +04:00

31 lines
865 B
Python

# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import logging
import secrets
import time
import requests
from tests.conftest import TrackedContainer, find_free_port
LOGGER = logging.getLogger(__name__)
def check_pluto_proxy(
container: TrackedContainer, http_client: requests.Session
) -> None:
host_port = find_free_port()
token = secrets.token_hex()
container.run_detached(
command=[
"start-notebook.py",
f"--IdentityProvider.token={token}",
],
ports={"8888/tcp": host_port},
)
# Give the server a bit of time to start
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"