test(responses): bound azure shell tool live call at 90s and skip on provider timeout - #32424
Conversation
…imeout The azure variant of test_responses_api_shell_tool always makes a live Azure call (its skip outcome means no VCR cassette is ever persisted). When Azure held the connection instead of answering, the call sat on litellm's 6000s responses deadline until CircleCI killed the whole job via no_output_timeout after 15m of silence (job 2013288). Bound the e2e call at 90s and skip on litellm.Timeout, matching the existing InternalServerError and BadRequestError skips, and give the llm_responses_api_testing job the same pytest-timeout guard the llm_translation_testing job already uses so no single hung test can consume the 15m no-output window again.
Greptile SummaryThis PR adds a 90-second client-side timeout and a
Confidence Score: 5/5Safe to merge — the change is confined to a test file, adds a hard timeout bound, and introduces a graceful skip path without weakening any assertions. Only one file is touched: a single test method gains a 90-second request timeout and a skip handler for that timeout. No production code is changed, no assertions are removed, and the existing skip paths for InternalServerError and BadRequestError are preserved. The fix is well-motivated and directly addresses the documented CI hang. No files require special attention.
|
| Filename | Overview |
|---|---|
| tests/llm_responses_api_testing/base_responses_api.py | Adds timeout=90 and a Timeout skip handler to test_responses_api_shell_tool; no logic weakened, existing assertions untouched. |
Reviews (2): Last reviewed commit: "test(responses): drop job-level pytest t..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…provider timeout (BerriAI#32424) * ci(responses): bound azure shell tool e2e call and enforce per-test timeout The azure variant of test_responses_api_shell_tool always makes a live Azure call (its skip outcome means no VCR cassette is ever persisted). When Azure held the connection instead of answering, the call sat on litellm's 6000s responses deadline until CircleCI killed the whole job via no_output_timeout after 15m of silence (job 2013288). Bound the e2e call at 90s and skip on litellm.Timeout, matching the existing InternalServerError and BadRequestError skips, and give the llm_responses_api_testing job the same pytest-timeout guard the llm_translation_testing job already uses so no single hung test can consume the 15m no-output window again. * test(responses): drop job-level pytest timeout, keep shell tool 90s bound
Relevant issues
Related to #32420, which bounds the suite's daily cassette re-record calls at the job level and reruns timeout-class failures once. This PR covers the one test in the suite that goes live on every run and so needs its own bound regardless of cassette state
Linear ticket
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
CircleCI job 2013288 (llm_responses_api_testing) hung for 15 minutes and was killed by
Too long with no output (exceeded 15m0s)at 98%. The hung test wastest_azure_responses_api.py::TestAzureResponsesAPITest::test_responses_api_shell_tool: it always runs live against Azure because its skip outcome ("shell not supported for this model") means the VCR persister never saves a cassette for it, and on that run Azure accepted the request and never answered. litellm's Responses API surface useslitellm.request_timeout= 6000s as its default HTTP deadline (timeout or request_timeoutinlitellm/responses/main.py), so no client-side timeout fired inside the 15m no-output window and the whole job died instead of the one testA hang like this cannot be reproduced against live Azure on demand (the same request normally answers in well under a second; on staging job 2013697 the test skips in 0.334s), so the repro below points
AZURE_AI_API_BASEat a real local TCP endpoint that accepts connections and never responds, which is exactly the observed provider behavior. No code is mocked; the test exercises the full litellm -> aiohttp stackBlack-hole endpoint used by both runs:
Before (4b0ac8b, the current base): the test hangs indefinitely, reproducing the CI incident; the run below produced no verdict and had to be killed externally after 150s
After (d3b5294): the same hang now resolves as a skip in 90s, the same graceful outcome the test already uses when Azure rejects the shell tool with a 400
Type
✅ Test
Changes
tests/llm_responses_api_testing/base_responses_api.py:test_responses_api_shell_toolnow passestimeout=90tolitellm.aresponsesand skips onlitellm.Timeout, mirroring its existing skips forInternalServerErrorand shell-not-supportedBadRequestError. This is the one test in the suite that goes live on every run (a skipping test never persists a cassette), so a provider-side hang previously inherited the Responses API default deadline of 6000s and ate the job's 15m no-output windowAn earlier revision of this PR also added a job-level pytest timeout of 120s to the CircleCI job. That was dropped: #32420 bounds the same job's live calls at 180s via
REQUEST_TIMEOUTand reruns timeout-class failures once, and a 120s per-test kill would fire before that 180s bound, terminating the worker process instead of surfacing a rerunnablelitellm.Timeout. The explicit per-calltimeout=90here composes cleanly with #32420 because a per-request timeout takes precedence over the job-level default