[CI] De-flake test_chat_completion_n_parameter_non_streaming (#41147)

Signed-off-by: haosdent <haosdent@gmail.com>
This commit is contained in:
haosdent
2026-04-29 03:23:59 +00:00
committed by GitHub
parent 4b95e9cec4
commit 75a7cf2c10
@@ -845,9 +845,10 @@ async def test_chat_completion_n_parameter_non_streaming(
chat_completion = await client.chat.completions.create( chat_completion = await client.chat.completions.create(
model=model_name, model=model_name,
messages=messages, messages=messages,
max_completion_tokens=20, max_completion_tokens=50,
temperature=0.7, temperature=1.0,
n=3, n=3,
seed=42,
stream=False, stream=False,
) )
@@ -859,7 +860,6 @@ async def test_chat_completion_n_parameter_non_streaming(
assert choice.message.content is not None assert choice.message.content is not None
assert len(choice.message.content) > 0 assert len(choice.message.content) > 0
# Verify all responses are different (highly likely with temperature > 0)
contents = [choice.message.content for choice in chat_completion.choices] contents = [choice.message.content for choice in chat_completion.choices]
assert len(set(contents)) > 1, "Expected different responses with n=3" assert len(set(contents)) > 1, "Expected different responses with n=3"