Honor configured timeout for synchronous API requests - #3995
Open
SiavashShams wants to merge 2 commits into
Open
Honor configured timeout for synchronous API requests#3995SiavashShams wants to merge 2 commits into
SiavashShams wants to merge 2 commits into
Conversation
SiavashShams
force-pushed
the
oss/api-sync-timeout-ignored-20260813-0100050700
branch
from
August 13, 2026 08:09
1c5efa7 to
a1c97dd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
TemplateAPIstores its configured timeout, but the synchronousrequests.postcall did not use it. Since synchronous requests are the default, an unresponsive endpoint could block without honoring the configured timeout.Change
Pass
self.timeoutto the synchronous request and add a regression test using a non-default timeout of 17 seconds.Tests
python -m pytest tests/models/test_api.py -k timeout -q: 1 passed; the regression test failed on the base commit withKeyError: 'timeout'.python -m pytest tests/models/test_api.py -q: 15 passed.pre-commit run --files lm_eval/models/api_models.py tests/models/test_api.py: reported existing whole-file lint violations outside the changed lines. A non-mutating Ruff comparison found 134 base diagnostics and 133 patched diagnostics inapi_models.py, removing the request-without-timeout diagnostic, and 4 diagnostics intest_api.pyboth before and after.pytest -x --showlocals -s -vv -n=auto --ignore=tests/models/test_openvino.py --ignore=tests/models/test_hf_steered.py --ignore=tests/scripts/test_zeno_visualize.py: not completed because OpenMP could not create sandboxed/tmpshared files and the xdist workers stalled before running tests.