A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 8, 05:00 UTC
[CI] Fix flaky test_parsable_context (#34717)
Signed-off-by: sfeng33 <4florafeng@gmail.com>
Flora Feng committed
Feb 17, 2026 at 13:42 UTC
1e4a084c8e53bfb422f64e2394fc94c4ed5b6cbf
1 file changed
+19
-12
tests/entrypoints/openai/responses/test_parsable_context.py
+19
-12
@@ -172,19 +172,26 @@ async def test_mcp_tool_call(client: OpenAI, model_name: str):
172
173
assert response is not None
174
assert response.status == "completed"
175
- assert response.output[0].type == "reasoning"
176
- assert response.output[1].type == "mcp_call"
177
- assert type(response.output[1].arguments) is str
178
- assert type(response.output[1].output) is str
179
- assert response.output[2].type == "reasoning"
180
- # make sure the correct math is in the final output
181
- assert response.output[3].type == "message"
182
- assert any(s in response.output[3].content[0].text for s in ("56088", "56,088"))
183
-
184
- # test raw input_messages / output_messages
175
+
176
+ # The model may produce multiple reasoning/mcp_call rounds before the
177
+ # final message, so validate structurally rather than by exact index.
178
+ output_types = [o.type for o in response.output]
179
+ assert "reasoning" in output_types
180
+ mcp_calls = [o for o in response.output if o.type == "mcp_call"]
181
+ assert len(mcp_calls) >= 1
182
+ assert type(mcp_calls[0].arguments) is str
183
+ assert type(mcp_calls[0].output) is str
184
+
185
+ # The final output should be a message containing the correct answer
186
+ assert response.output[-1].type == "message"
187
+ assert any(s in response.output[-1].content[0].text for s in ("56088", "56,088"))
188
+
189
+ # Test raw input_messages / output_messages
190
assert len(response.input_messages) == 1
186
- assert len(response.output_messages) == 3
187
- assert any(s in response.output_messages[2]["message"] for s in ("56088", "56,088"))
191
+ assert len(response.output_messages) >= 3
192
+ assert any(
193
+ s in response.output_messages[-1]["message"] for s in ("56088", "56,088")
194
+ )
195
196
197
@pytest.mark.asyncio