From 98f1ab46a9e8893cd556dffc8317aca8122234d7 Mon Sep 17 00:00:00 2001 From: YuBaoku <49938469+EmmonsCurse@users.noreply.github.com> Date: Mon, 24 Nov 2025 10:49:17 +0800 Subject: [PATCH] [CI] add output for last_token in test_streaming_with_stop_str (#5170) --- tests/ci_use/EB_Lite/test_EB_Lite_serving.py | 4 ++-- tests/e2e/test_EB_Lite_serving.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/ci_use/EB_Lite/test_EB_Lite_serving.py b/tests/ci_use/EB_Lite/test_EB_Lite_serving.py index 0c73f0c04..5279a71e3 100644 --- a/tests/ci_use/EB_Lite/test_EB_Lite_serving.py +++ b/tests/ci_use/EB_Lite/test_EB_Lite_serving.py @@ -385,14 +385,14 @@ def test_streaming_with_stop_str(openai_client): messages=[{"role": "user", "content": "Hello, how are you?"}], temperature=1, max_tokens=5, - extra_body={"include_stop_str_in_output": True}, + extra_body={"min_tokens": 1, "include_stop_str_in_output": True}, stream=True, ) # Assertions to check the response structure last_token = "" for chunk in response: last_token = chunk.choices[0].delta.content - assert last_token.endswith("") + assert last_token.endswith(""), f"last_token did not end with '': {last_token!r}" response = openai_client.chat.completions.create( model="default", diff --git a/tests/e2e/test_EB_Lite_serving.py b/tests/e2e/test_EB_Lite_serving.py index b959ffcdc..64bee78c1 100644 --- a/tests/e2e/test_EB_Lite_serving.py +++ b/tests/e2e/test_EB_Lite_serving.py @@ -539,14 +539,14 @@ def test_streaming_with_stop_str(openai_client): messages=[{"role": "user", "content": "Hello, how are you?"}], temperature=1, max_tokens=5, - extra_body={"include_stop_str_in_output": True}, + extra_body={"min_tokens": 1, "include_stop_str_in_output": True}, stream=True, ) # Assertions to check the response structure last_token = "" for chunk in response: last_token = chunk.choices[0].delta.content - assert last_token.endswith("") + assert last_token.endswith(""), f"last_token did not end with '': {last_token!r}" response = openai_client.chat.completions.create( model="default",