[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:
co-authored by
gemini-code-assist[bot]
parent
2274bfebb1
commit
2aa3fe394e
@@ -546,21 +546,21 @@ def try_cached_model(model_repo: str):
|
|||||||
return model_dir if model_dir else model_repo
|
return model_dir if model_dir else model_repo
|
||||||
|
|
||||||
|
|
||||||
def popen_with_error_check(command: list[str], allow_exit: bool = False):
|
def popen_with_error_check(command: list[str]):
|
||||||
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
process = subprocess.Popen(command, stdout=None, stderr=None)
|
||||||
|
|
||||||
def _run_and_check():
|
def _run_and_check():
|
||||||
stdout, stderr = process.communicate()
|
process.wait()
|
||||||
|
|
||||||
while process.poll() is None:
|
if process.returncode == -9:
|
||||||
time.sleep(5)
|
return
|
||||||
|
|
||||||
if not allow_exit or process.returncode != 0:
|
if process.returncode != 0:
|
||||||
raise Exception(
|
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()
|
t.start()
|
||||||
return process
|
return process
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user