Files
vLLM/tests/entrypoints/unit_tests/test_remote_vllm_server.py
T
Andreas KaratzasandOpenAI Codex cb58bb9c1e [CI] Harden RemoteVLLMServer GPU cleanup checks (#52282)
Signed-off-by: Andreas Karatzas <akaratza@amd.com>
Signed-off-by: Andreas Karatzas <Andreas.Karatzas@amd.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
2026-08-19 14:17:17 -05:00

34 lines
1.0 KiB
Python

# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
from unittest.mock import Mock
import pytest
import tests.utils as test_utils
from tests.utils import RemoteOpenAIServer
def test_openai_server_shutdown_wait_covers_engine_cleanup(
monkeypatch: pytest.MonkeyPatch,
):
server = object.__new__(RemoteOpenAIServer)
server._request_shutdown_timeout = 0.0
server.proc = Mock(pid=1234)
engine_timeout_args = []
def get_engine_timeout(request_timeout, process_timeout):
engine_timeout_args.append((request_timeout, process_timeout))
return 60.0
monkeypatch.setattr(
test_utils, "get_engine_process_shutdown_timeout", get_engine_timeout
)
monkeypatch.setattr(test_utils.os, "getpgid", lambda pid: pid)
monkeypatch.setattr(server, "_kill_process_group_survivors", Mock())
server._terminate_process_tree()
assert engine_timeout_args == [(0.0, 0.0)]
server.proc.wait.assert_called_once_with(timeout=75.0)