Skip to content

Commit d84a35e

Browse files
committed
[Bugfix] increase timeout of POST /v1/chat/completions to 60s
Increase both Schemathesis and Hypothesis timeouts (they are configured separately) to 60s to allow the test to pass comfortably in both CI and in local testing. We are interested in testing the OpenAPI schema here not performance. Signed-off-by: David Xia <[email protected]>
1 parent 474e367 commit d84a35e

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

tests/entrypoints/openai/test_openai_schema.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# SPDX-License-Identifier: Apache-2.0
2+
from typing import Final
3+
24
import pytest
35
import schemathesis
6+
from hypothesis import settings
47
from schemathesis import GenerationConfig
58

69
from ...utils import RemoteOpenAIServer
@@ -9,6 +12,7 @@
912

1013
MODEL_NAME = "HuggingFaceTB/SmolVLM-256M-Instruct"
1114
MAXIMUM_IMAGES = 2
15+
DEFAULT_TIMEOUT_SECONDS: Final[int] = 10
1216

1317

1418
@pytest.fixture(scope="module")
@@ -89,6 +93,15 @@ def no_file_type(case: schemathesis.models.Case):
8993

9094
@schema.parametrize()
9195
@schema.override(headers={"Content-Type": "application/json"})
96+
@settings(deadline=60000)
9297
def test_openapi_stateless(case: schemathesis.Case):
98+
key = (
99+
case.operation.method.upper(),
100+
case.operation.path,
101+
)
102+
timeout = {
103+
("POST", "/v1/chat/completions"): 60,
104+
}.get(key, DEFAULT_TIMEOUT_SECONDS)
105+
93106
#No need to verify SSL certificate for localhost
94-
case.call_and_validate(verify=False)
107+
case.call_and_validate(verify=False, timeout=timeout)

0 commit comments

Comments
 (0)