Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions tests/entrypoints/launchers/test_dp_supervisor.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,28 @@ def test_validate_multi_port_external_lb_args_allows_ssl():
validate_multi_port_external_lb_args(args)


@pytest.mark.parametrize(
("host", "use_ssl", "expected"),
[
(None, False, "http://127.0.0.1:8001"),
("0.0.0.0", False, "http://127.0.0.1:8001"),
("localhost", False, "http://localhost:8001"),
("::", False, "http://[::1]:8001"),
("fd00::1", False, "http://[fd00::1]:8001"),
("::", True, "https://[::1]:8001"),
],
)
def test_child_base_url_brackets_ipv6_hosts(host, use_ssl, expected):
"""Probe URLs must bracket IPv6 hosts; aiohttp rejects unbracketed ones."""
ssl_args = (
{"ssl_keyfile": "/tmp/server.key", "ssl_certfile": "/tmp/server.crt"}
if use_ssl
else {}
)
args = _make_unit_args(host=host, **ssl_args)
assert dp_sup._child_base_url(args, 8001) == expected


def test_aggregates_health():
supervisor = DPSupervisor(_make_unit_args())
supervisor._is_ready = True
Expand Down
3 changes: 2 additions & 1 deletion vllm/entrypoints/launchers/dp_supervisor.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import vllm.envs as envs
from vllm.logger import configure_logging_from_args, init_logger
from vllm.utils.network_utils import join_host_port
from vllm.utils.system_utils import (
decorate_logs,
kill_process_tree,
Expand Down Expand Up @@ -162,7 +163,7 @@ def _child_base_url(args: argparse.Namespace, port: int) -> str:
elif host == "::":
host = "::1"
scheme = "https" if args.ssl_keyfile and args.ssl_certfile else "http"
return f"{scheme}://{host}:{port}"
return f"{scheme}://{join_host_port(host, port)}"


def _join_processes_with_timeout(processes: list[BaseProcess], timeout: float) -> None:
Expand Down
Loading