From d6f0b7a4166b325b4dda6512e2e06dcb581923ba Mon Sep 17 00:00:00 2001 From: Oxana Korzh Date: Thu, 15 Oct 2026 10:08:14 -0600 Subject: [PATCH] [CI] Skip exited descendants when finding the worker in the FT e2e test (#61648) Signed-off-by: Oxana Korzh Co-authored-by: Claude Opus 5.5 Co-authored-by: Andreas Karatzas --- tests/v1/fault_tolerance/test_fault_tolerance_e2e.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/v1/fault_tolerance/test_fault_tolerance_e2e.py b/tests/v1/fault_tolerance/test_fault_tolerance_e2e.py index f6d15343b5..27e45f6635 100644 --- a/tests/v1/fault_tolerance/test_fault_tolerance_e2e.py +++ b/tests/v1/fault_tolerance/test_fault_tolerance_e2e.py @@ -190,11 +190,13 @@ def _apply_ft(server, instruction: str, params: dict | None = None) -> dict: def _kill_worker_process(server) -> None: """SIGKILL only the worker proc, leaving EngineCore and API server alive.""" - workers = [ - p - for p in psutil.Process(server.proc.pid).children(recursive=True) - if "Worker" in " ".join(p.cmdline()) - ] + workers = [] + for p in psutil.Process(server.proc.pid).children(recursive=True): + # Skip descendants that already exited: cmdline() raises ZombieProcess + # if unreaped, NoSuchProcess if reaped. A dead worker still fails below. + with contextlib.suppress(psutil.ZombieProcess, psutil.NoSuchProcess): + if "Worker" in " ".join(p.cmdline()): + workers.append(p) assert len(workers) == 1, f"expected 1 worker proc, found: {workers}" workers[0].kill()