[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>
This commit is contained in:
Andreas Karatzas
2026-08-19 14:17:17 -05:00
committed by GitHub
co-authored by OpenAI Codex
parent 480d4f0d15
commit cb58bb9c1e
3 changed files with 59 additions and 9 deletions
@@ -0,0 +1,33 @@
# 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)