test: fix staging CI regressions from #38182, #38144, #38265, #37962, and #37969 - #38304
Merged
yuneng-berri merged 2 commits intoAug 28, 2026
Merged
Conversation
… and #37969 - test_custom_callback_input: audio redaction assertion expects None content (redaction leaves None untouched, gpt-audio-1.5 returns content=None) - local_testing conftest: drain GLOBAL_LOGGING_WORKER in isolate_litellm_state teardown so mocked-router tests stop leaking pending logging tasks into test_gcs_pub_sub - test_together_ai: tools is always a supported param now; only response_format is gated by function-calling support - test_keys: /team/new omits models instead of sending null (422), so the key's team really exists and auth no longer raises TeamNotFoundError - test_team_delete_member_add_race: per-test unique team and user ids so xdist workers sharing one Postgres stop deleting each other's team mid-race
Contributor
Greptile SummaryThe PR updates staging tests and their isolation infrastructure to reflect current audio and team behavior and avoid shared-state collisions.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| tests/local_testing/conftest.py | Adds teardown-time draining of the global logging queue to prevent work leaking between tests. |
| tests/local_testing/test_custom_callback_input.py | Updates the audio logging assertion to distinguish streaming redacted content from non-streaming null content. |
| tests/proxy_admin_ui_tests/test_team_delete_member_add_race.py | Replaces shared database identifiers with per-test UUID-based identifiers and threads them through setup, assertions, and cleanup. |
| tests/test_keys.py | Omits models when unset during team creation and verifies that the requested team was created before generating its key. |
Reviews (2): Last reviewed commit: "Merge branch 'litellm_internal_staging' ..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
yuneng-berri
approved these changes
Aug 28, 2026
…egressions Resolve tests/llm_translation/test_together_ai.py in favor of staging: bcb6a0a already landed the fail-open assertion for models missing from the registry, so both models now list response_format and tools. This branch's narrower gating of response_format no longer matches behavior.
yuneng-berri
enabled auto-merge
August 28, 2026 06:14
Contributor
Author
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.
TLDR
Problem this solves:
How it solves it:
content=None(redaction leaves None untouched)toolsalways supported,response_formatgatedmodels: null, so the team really existsUser Flow
Before: a maintainer merges an unrelated PR into
litellm_internal_stagingand the staging CircleCI run comes back red with test failures their change never touchedlocal_testing_part1is red:test_redacted_message_logging[True-False]fails asserting"redacted-by-litellm" == Noneon the gpt-audio response, andtest_gcs_pub_subfails with "carried 1 pending logging task" leaked from an earlier testllm_translation_testingis red:test_get_supported_openai_paramsfails becausetoolsnow shows up for a Together model the test expected it stripped frombuild_and_testis red: fourtest_key_model_list[/v1/models-key-*]cases fail with 404 "Team doesn't exist in db", because the test's/team/newcall sends"models": null, gets a 422 it never checks, then issues a key against the team that was never createdauth_ui_unit_testsis red: the two team-race tests fail intermittently when parallel workers, all using the same hardcoded team id, delete each other's team mid-testAfter: the same merge comes back green because the tests now match intended behavior and stop tripping over each other
local_testing_part1is green: the redaction test accepts the audio model's empty text content, and each test drains its own pending logging work before the next one startsllm_translation_testingis green: the Together test expectstoolsto be supported and onlyresponse_formatto be gatedbuild_and_testis green: the test creates its team without the null field,/team/newreturns 200, and the key's/v1/modelscall returns the team's modelsauth_ui_unit_testsis green: each race test run uses its own unique team and user ids, so parallel workers never collideRelevant issues
Regressions introduced by #38182, #38144, #38265, #37962, and #37969, first seen in the staging run for 72b8b47 (CircleCI workflow 7e7cff9b, jobs 2137083, 2137086, 2137096, and 2137108)
Linear ticket
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/test_litellm/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more@greptileaito re-request a review after pushing changes)Screenshots / Proof of Fix
All runs below are against live services: real OpenAI calls for the redaction tests, a live proxy on
postgresql://localhost/lit_keysfor test_keys, and a shared local Postgres for the xdist race runsBefore (273b01a)
Audio redaction (real gpt-audio-1.5 call)
pytest tests/local_testing/test_custom_callback_input.py -k test_redacted_message_logging -qFAILED ...[True-False] - AssertionError: assert None == 'redacted-by-litellm'(non-stream audio response hascontent=None)Logging-worker leak into test_gcs_pub_sub
pytest <mocked-router-test> tests/local_testing/test_gcs_pub_sub.py -q(any earlier test that queues logging work, then the GCS test)FAILED tests/local_testing/test_gcs_pub_sub.py::test_gcs_pub_sub - Event loop ... carried 1 pending logging taskTogether supported params
pytest tests/llm_translation/test_together_ai.py -k test_get_supported_openai_params -qFAILED ...[together_ai/Qwen/Qwen3-235B-A22B-fp8-tput-False] - AssertionError: assert 'tools' not in [...]( fix(together_ai): pass tools through for models missing from the registry #38265 madetoolsalways listed)test_key_model_list against a live proxy
curl -X POST http://0.0.0.0:32963/team/new -H 'Authorization: Bearer sk-1234' -d '{"team_id":"proof-null-team","models":null}'returnsHTTP 422 {"detail":[{"type":"list_type","loc":["body","models"],"msg":"Input should be a valid list","input":null}]}, which the test never checkedcurl -X POST http://0.0.0.0:32963/key/generate ... -d '{"team_id":"proof-null-team","models":["gpt-4"]}'still hands back a keycurl http://0.0.0.0:32963/v1/models -H "Authorization: Bearer <that key>"returnsHTTP 404 {"error":{"message":"{'error': \"Team doesn't exist in db. Team=proof-null-team...\"}"}}( fix(auth): stop the team fallback from widening model access #37962 stopped vouching for unknown teams)pytest tests/test_keys.py -k test_key_model_list -q(HEAD copy pointed at the live proxy):4 failed, 4 passedwith all fourkey-*cases failing on that 404Team race tests under xdist
pytest tests/proxy_admin_ui_tests/test_team_delete_member_add_race.py -n 3 -qthree times against one shared Postgres2 failed, 1 passedevery run: workers share the hardcodedlit5544-race-teamid and delete each other's team mid-raceAfter (0e999e3)
Audio redaction (real gpt-audio-1.5 call)
pytest tests/local_testing/test_custom_callback_input.py -k test_redacted_message_logging -q2 passedLogging-worker leak into test_gcs_pub_sub
pytest <mocked-router-test> tests/local_testing/test_gcs_pub_sub.py -q2 passed; the teardown drain adds 0.29s to the leaking test and nothing measurable elsewhereTogether supported params
pytest tests/llm_translation/test_together_ai.py -k test_get_supported_openai_params -q2 passed:toolsasserted present for both models,response_formatonly for the function-calling onetest_key_model_list against a live proxy
curl -X POST http://0.0.0.0:32963/team/new -H 'Authorization: Bearer sk-1234' -d '{"team_id":"proof-omit-team"}'(models omitted, as the test now sends) returnsHTTP 200with the created teamcurl -X POST http://0.0.0.0:32963/key/generate ... -d '{"team_id":"proof-omit-team","models":["gpt-4"]}'hands back a keycurl http://0.0.0.0:32963/v1/models -H "Authorization: Bearer <that key>"returnsHTTP 200 {"data":[{"id":"gpt-4",...}]}pytest tests/test_keys.py -k test_key_model_list -qagainst the same proxy:8 passedTeam race tests under xdist
pytest tests/proxy_admin_ui_tests/test_team_delete_member_add_race.py -n 3 -qthree times against the same shared Postgres3 passedevery runType
✅ Test
Caveats (if any)
Medium
Low
Final Attestation
The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR
0e999e3 passes /live-pr-risk