Skip to content

test: update integration tests left stale by recent product changes - #49143

Merged
yuneng-berri merged 2 commits into
mainfrom
litellm_test_719647
Oct 30, 2026
Merged

yuneng-berri merged 2 commits into
mainfrom
litellm_test_719647

Conversation

@yuneng-berri

@yuneng-berri yuneng-berri commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Several merged PRs changed product behavior on purpose but left integration tests asserting the old behavior, so 149 integration cases fail on main for reasons that are not bugs. This updates those tests to the current behavior while keeping what each test protects, and changes no product code

Details

TLDR

Problem this solves:

  • 149 integration cases on main fail on stale expectations
  • Real failures are hard to spot among them

How it solves it:

  • Each test now asserts the behavior its causing PR intended
  • Isolation and regression checks are kept, not loosened to ANY

Causes, by the PR that changed behavior:

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • The handful of test files covering my change pass locally, e.g. uv run pytest tests/unit/<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
  • My PR passes all required CI/CD checks (e.g., lint, schema.d.ts sync check, etc.)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • Every automated review on my PR's latest commit has finished, and I have addressed or replied to each of its findings before requesting a maintainer review

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

E2E exception at b6a5969. The change is test-only, so the proof is the integration harness itself, run before and after against real Postgres and Redis with the license set

Scope is the 24 changed files, one of them removed. Rationale is that no product code changes, so there is no user-facing request to replay

Before, on main. Scheduled run https://github.com/BerriAI/litellm/actions/runs/40956051816 at 4ce724e failed these 149 cases. Each one was reproduced locally on this branch before its edit, with the same assertion as CI

After, at c86e433, every changed file was run in full locally through tests/integration/run.py <group> --workers 4 <files>

Group Passed Failed Skipped
providers 525 14 0
mcp 315 1 3
extensions 89 1 6
management 8 0 0
accounting 19 1 0

The 14 providers failures in that table were the anthropic Rust Messages cases, which b6a5969 updates. At b6a5969 the safeguards wire and chaos files, both keepalive files and the Python reconnect routes file that covers the removed one ran in full, with 40 passed and 0 failed

None of the other failures is one this PR targets

  • The mcp failure binds 127.0.0.2, which a stock Mac lacks. It passes in CI
  • The extensions failure is a client-disconnect case that also fails on main and is out of scope
  • The accounting failure is test_sigterm_http_drain_consumes_callback_budget[True], which fails the same way locally on unmodified main because gunicorn workers crash on macOS. It passes in CI

make lint passes at c86e433, including every lint gate. At b6a5969 ruff, the test quality gate and the CI coverage check pass

Type

Test

Caveats (if any)

Medium

  • Integration groups don't run on this PR, so CI won't show these results
    • The next scheduled main run after merge confirms them

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

Note

Low Risk
Changes are limited to integration tests and golden fixtures; runtime behavior is unchanged, so merge risk is misaligned expectations rather than production regressions.

Overview
Test-only PR — no product code changes. Integration expectations are brought in line with behavior shipped in recent merges so CI/main no longer fails on stale assertions while keeping the same isolation and regression intent.

MCP catalog / guardrails: Catalog-echo tests now use peers that return a fresh tool description on each list/fetch, asserting cold probes see a fetched description that differs from the caller’s served listing (not an empty “unlisted” sentinel). Credential, access-matrix, toolset, OAuth token-exchange, resilience, and LLM-bridge tests follow the same pattern. MCP guardrail denial expectations move from 400 to 403 with structured detail. OAuth UI session cookies are built with a live scenario.key embedded in JWT claims.

Spend, routing, providers: Databricks serving-endpoint classifier/decisions tests expect non-zero spend from model_prices_and_context_window.json instead of 0.0. Daily-activity goldens drop the __ptu_flat_cost__ breakdown entry. Shutdown-flush concurrency waits on /health/backlog in-flight count instead of a removed log line. Responses-bridge translation cases expect provider_specific_fields (phase, openai_responses_replay) and strip replay from follow-up fixtures where needed. Provider wire tests update for client tool_search on Anthropic, hosted_vllm decisions with images, inferenceapis public endpoints matching bundled provider data, and Vertex/Deepseek safeguard routes not using Rust.

Reviewed by Cursor Bugbot for commit c86e433. Bugbot is set up for automated code reviews on this repo. Configure here.

@yuneng-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit c86e433. Configure here.

@codecov

codecov Bot commented Oct 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@yuneng-berri
yuneng-berri merged commit d76db47 into main Oct 30, 2026
87 checks passed
@yuneng-berri
yuneng-berri deleted the litellm_test_719647 branch October 30, 2026 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants