From b373b5102aac3493200c9b04ff7a3e1943c17fdd Mon Sep 17 00:00:00 2001 From: Nick Hill Date: Fri, 13 Mar 2026 00:32:55 -0700 Subject: [PATCH] [Tests] Shutdown test `RemoteVLLMServer` cleanly (#36950) Recent PR #33949 changed the teardown logic of the RemoteVLLMServer test utility class to send SIGTERM to all vllm (sub)processes at once, which breaks the clean/coordinated shutdown logic that assumes only the top-level process will receive a signal (for example when running in a container that's shut down). This caused a bunch of errors and stacktraces in some test logs, even though those tests still pass. We should still attempt a normal shutdown and only kill other procs if they are still running after a few seconds. Example: tests/v1/distributed/test_external_lb_dp.py::test_external_lb_completion_streaming Signed-off-by: Nick Hill --- tests/utils.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/utils.py b/tests/utils.py index e24eda90f2..d14c32e295 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -235,13 +235,10 @@ class RemoteVLLMServer: except (ProcessLookupError, OSError): pgid = None - # Phase 1: graceful SIGTERM to the entire process group - if pgid is not None: - with contextlib.suppress(ProcessLookupError, OSError): - os.killpg(pgid, signal.SIGTERM) - print(f"[RemoteOpenAIServer] Sent SIGTERM to process group {pgid}") - else: + # Phase 1: graceful SIGTERM to the root process + with contextlib.suppress(ProcessLookupError, OSError): self.proc.terminate() + print(f"[RemoteOpenAIServer] Sent SIGTERM to process {pid}") try: self.proc.wait(timeout=15)