[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>
This commit is contained in:
Liangsheng Yin
2026-02-23 12:41:03 -08:00
committed by GitHub
parent 2274bfebb1
commit 2aa3fe394e

View File

@@ -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