From 2148914e1b4740a812d01776d5e5c38257a10552 Mon Sep 17 00:00:00 2001 From: Lianmin Zheng Date: Fri, 25 Oct 2024 08:00:55 -0700 Subject: [PATCH] Fix log parsing in the chunked prefill unit tests (#1793) --- python/sglang/test/test_utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/sglang/test/test_utils.py b/python/sglang/test/test_utils.py index 20fc9d52d..f802a9389 100644 --- a/python/sglang/test/test_utils.py +++ b/python/sglang/test/test_utils.py @@ -640,15 +640,17 @@ STDERR_FILENAME = "stderr.txt" def read_output(output_lines): + """Print the output in real time with another thread.""" pt = 0 while pt >= 0: - if pt > 0 and os.path.exists(STDERR_FILENAME): + if pt > 0 and not os.path.exists(STDERR_FILENAME): break lines = open(STDERR_FILENAME).readlines() output_lines[:] = lines for line in lines[pt:]: print(line, end="", flush=True) pt += 1 + time.sleep(0.1) def run_mmlu_test(