From 2aa3fe394e2debaf7f1aafc3933f5f6321d0ac59 Mon Sep 17 00:00:00 2001 From: Liangsheng Yin Date: Mon, 23 Feb 2026 12:41:03 -0800 Subject: [PATCH] [CI] fix the teardown output of disaggregation test (#19193) Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- python/sglang/test/test_utils.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/python/sglang/test/test_utils.py b/python/sglang/test/test_utils.py index 1bacdadff..888a1fe93 100644 --- a/python/sglang/test/test_utils.py +++ b/python/sglang/test/test_utils.py @@ -546,21 +546,21 @@ def try_cached_model(model_repo: str): return model_dir if model_dir else model_repo -def popen_with_error_check(command: list[str], allow_exit: bool = False): - process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) +def popen_with_error_check(command: list[str]): + process = subprocess.Popen(command, stdout=None, stderr=None) def _run_and_check(): - stdout, stderr = process.communicate() + process.wait() - while process.poll() is None: - time.sleep(5) + if process.returncode == -9: + return - if not allow_exit or process.returncode != 0: + if process.returncode != 0: raise Exception( - f"{command} exited with code {process.returncode}\n{stdout=}\n{stderr=}" + f"{shlex.join(command)} exited with code {process.returncode}" ) - t = threading.Thread(target=_run_and_check) + t = threading.Thread(target=_run_and_check, daemon=True) t.start() return process