From 21de6d4b02edb393adea68833ef5822125a9203d Mon Sep 17 00:00:00 2001 From: Andreas Karatzas Date: Wed, 31 Dec 2025 17:05:14 -0600 Subject: [PATCH] [CI][Bugfix] Fix token counting in chunked prefill streaming test (#31565) Signed-off-by: Andreas Karatzas --- tests/entrypoints/openai/test_chunked_prompt.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/entrypoints/openai/test_chunked_prompt.py b/tests/entrypoints/openai/test_chunked_prompt.py index f5c4121077..cbd351beb4 100644 --- a/tests/entrypoints/openai/test_chunked_prompt.py +++ b/tests/entrypoints/openai/test_chunked_prompt.py @@ -116,7 +116,10 @@ async def test_chat_completion_stream_options_and_logprobs_with_long_prompts( assert chunk.choices[0].logprobs is None empty_chunks_received += 1 else: - tokens_received += 1 + # Count actual tokens from logprobs since multiple tokens + # can be batched into a single chunk + assert chunk.choices[0].logprobs and chunk.choices[0].logprobs.content + tokens_received += len(chunk.choices[0].logprobs.content) if chunk.choices[0].finish_reason is not None: finished = True