diff --git a/tests/e2e/llm_translation/test_deepseek_reasoning_e2e.py b/tests/e2e/llm_translation/test_deepseek_reasoning_e2e.py index 8dfccf0d74b..ad808048c0b 100644 --- a/tests/e2e/llm_translation/test_deepseek_reasoning_e2e.py +++ b/tests/e2e/llm_translation/test_deepseek_reasoning_e2e.py @@ -29,6 +29,7 @@ pytestmark = pytest.mark.e2e REASONER = "deepseek/deepseek-v4-pro" PROMPT = "What is 17 + 26? Answer with just the number." +REASONER_TIMEOUT_SECONDS = 240.0 def _register_reasoner(client: PassthroughClient, resources: ResourceManager) -> str: @@ -63,6 +64,7 @@ class TestDeepSeekReasoningDisable: messages=[ChatMessage(role="user", content=PROMPT)], max_tokens=64, ), + timeout=REASONER_TIMEOUT_SECONDS, ) ) reasoning = _reasoning_content(response) @@ -86,6 +88,7 @@ class TestDeepSeekReasoningDisable: max_tokens=64, reasoning_effort="none", ), + timeout=REASONER_TIMEOUT_SECONDS, ) ) assert not _reasoning_content(response), ( @@ -108,6 +111,7 @@ class TestDeepSeekReasoningDisable: max_tokens=64, thinking=ThinkingParam(type="disabled"), ), + timeout=REASONER_TIMEOUT_SECONDS, ) ) assert not _reasoning_content(response), ( diff --git a/tests/e2e/proxy_client.py b/tests/e2e/proxy_client.py index 2627bdb8038..7dc8d204498 100644 --- a/tests/e2e/proxy_client.py +++ b/tests/e2e/proxy_client.py @@ -269,12 +269,13 @@ class ProxyClient: # ---- LLM calls ------------------------------------------------------ - def chat(self, key: str, body: ChatBody) -> Result[ChatResponse]: + def chat(self, key: str, body: ChatBody, timeout: float | None = None) -> Result[ChatResponse]: return self.transport.post( "/chat/completions", headers=self.transport.bearer(key), json=body, response_type=ChatResponse, + timeout=timeout, ) def chat_stream(self, key: str, body: ChatBody) -> StreamingResponse: diff --git a/tests/e2e/transport.py b/tests/e2e/transport.py index a6adf83ed1f..a4cae262b91 100644 --- a/tests/e2e/transport.py +++ b/tests/e2e/transport.py @@ -25,7 +25,13 @@ from e2e_http import ( class Transport(Protocol): def post[R: BaseModel]( - self, path: str, *, headers: BaseModel, json: BaseModel, response_type: type[R] + self, + path: str, + *, + headers: BaseModel, + json: BaseModel, + response_type: type[R], + timeout: float | None = None, ) -> Result[R]: ... def stream( @@ -119,14 +125,20 @@ class HttpTransport: return self.bearer(self.master_key) def post[R: BaseModel]( - self, path: str, *, headers: BaseModel, json: BaseModel, response_type: type[R] + self, + path: str, + *, + headers: BaseModel, + json: BaseModel, + response_type: type[R], + timeout: float | None = None, ) -> Result[R]: return e2e_http.post( self._url(path), headers=headers, json=json, response_type=response_type, - timeout=self.request_timeout, + timeout=timeout if timeout is not None else self.request_timeout, ) def get[R: BaseModel]( @@ -323,10 +335,16 @@ class SplitTransport: return self.data.master def post[R: BaseModel]( - self, path: str, *, headers: BaseModel, json: BaseModel, response_type: type[R] + self, + path: str, + *, + headers: BaseModel, + json: BaseModel, + response_type: type[R], + timeout: float | None = None, ) -> Result[R]: return self._route(path).post( - path, headers=headers, json=json, response_type=response_type + path, headers=headers, json=json, response_type=response_type, timeout=timeout ) def get[R: BaseModel](