From 40900baea7f689e9175a70b9683b5a4fe9be1dc8 Mon Sep 17 00:00:00 2001 From: Lianmin Zheng Date: Fri, 25 Oct 2024 08:31:08 -0700 Subject: [PATCH] [Fix] Fix the log parsing in chunked prefill uni tests (#1794) --- python/sglang/test/test_utils.py | 11 ++++++++--- test/srt/run_suite.py | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/python/sglang/test/test_utils.py b/python/sglang/test/test_utils.py index 7bb5a69d7..d6b5d41dc 100644 --- a/python/sglang/test/test_utils.py +++ b/python/sglang/test/test_utils.py @@ -641,14 +641,17 @@ STDERR_FILENAME = "stderr.txt" def read_output(output_lines): """Print the output in real time with another thread.""" + while not os.path.exists(STDERR_FILENAME): + time.sleep(1) + pt = 0 while pt >= 0: 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) + output_lines.append(line) pt += 1 time.sleep(0.1) @@ -709,8 +712,10 @@ def run_mmlu_test( kill_child_process(process.pid) stdout.close() stderr.close() - os.remove(STDOUT_FILENAME) - os.remove(STDERR_FILENAME) + if os.path.exists(STDOUT_FILENAME): + os.remove(STDOUT_FILENAME) + if os.path.exists(STDERR_FILENAME): + os.remove(STDERR_FILENAME) t.join() # Assert success diff --git a/test/srt/run_suite.py b/test/srt/run_suite.py index 2b1be4ed7..924652622 100644 --- a/test/srt/run_suite.py +++ b/test/srt/run_suite.py @@ -5,7 +5,6 @@ from sglang.test.test_utils import run_unittest_files suites = { "minimal": [ - "test_radix_attention.py", "models/test_embedding_models.py", "models/test_generation_models.py", "models/test_lora.py", @@ -20,6 +19,7 @@ suites = { "test_openai_server.py", "test_overlap_schedule.py", "test_pytorch_sampling_backend.py", + "test_radix_attention.py", "test_retract_decode.py", "test_server_args.py", "test_skip_tokenizer_init.py",