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 1, 21:15 UTC
[Bugfix] Fix test_invocations flaky failure with newer openai SDK (#44618)
Signed-off-by: Xu Zhou <xuzhou9417@163.com> Co-authored-by: Xu Zhou <xuzhou9417@163.com>
XuZhou committed
Jun 5, 2026 at 15:36 UTC
6542d48964be70dad281ce5e2675e287d394938f
1 file changed
+8
-2
tests/entrypoints/openai/chat_completion/test_chat.py
+8
-2
@@ -808,14 +808,20 @@ async def test_invocations(server: RemoteOpenAIServer, client: openai.AsyncOpenA
808
"logprobs": False,
809
}
810
811
- chat_completion = await client.chat.completions.create(**request_args)
811
+ # Use raw HTTP for both endpoints so we compare server responses
812
+ # directly, without the openai SDK injecting extra fields
813
+ # (e.g. `moderation` added in newer SDK versions).
814
+ chat_response = requests.post(
815
+ server.url_for("v1/chat/completions"), json=request_args
816
+ )
817
+ chat_response.raise_for_status()
818
819
invocation_response = requests.post(
820
server.url_for("invocations"), json=request_args
821
)
822
invocation_response.raise_for_status()
823
818
- chat_output = chat_completion.model_dump()
824
+ chat_output = chat_response.json()
825
invocation_output = invocation_response.json()
826
827
assert chat_output.keys() == invocation_output.keys()