Test server listening on IPv4/IPv6 (#2255)

* Test server listening on IPv4/IPv6

* Set up Docker in create-dev-env

* Show docker version

* Add info about docker client

* Check requests

* Show docker client version

* Try to pass docker sock

* Fix

* Break fast

* Revert

* Cleanup

* Better naming

* Always use docker.from_env

* Revert "Always use docker.from_env"

This reverts commit d03069ac28.

* Use custom docker client for only one test

* More logs

* Use cont_data_dir in test, so workdir doesn't matter

* Use common variable names

* Move patch to a separate function

* Try to use set-host option

* Use the same docker client in get_health

* Use .api

* Rewrite check_listening.py to use one function for both ipv4 and ipv6

* Add links to explain why we need to set up docker manually
This commit is contained in:
Ayaz Salikhov
2025-03-20 17:12:22 +00:00
committed by GitHub
parent 951dec9330
commit b35f1554d6
6 changed files with 134 additions and 9 deletions

View File

@@ -1,5 +1,6 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import logging
import os
from collections.abc import Generator
@@ -11,6 +12,8 @@ from urllib3.util.retry import Retry
from tests.utils.tracked_container import TrackedContainer
LOGGER = logging.getLogger(__name__)
@pytest.fixture(scope="session")
def http_client() -> requests.Session:
@@ -25,7 +28,9 @@ def http_client() -> requests.Session:
@pytest.fixture(scope="session")
def docker_client() -> docker.DockerClient:
"""Docker client configured based on the host environment"""
return docker.from_env()
client = docker.from_env()
LOGGER.info(f"Docker client created: {client.version()}")
return client
@pytest.fixture(scope="session")