Skip to content

test(integration): backport five integration flake fixes to rc/1.108.0 - #49555

Merged
yuneng-berri merged 3 commits into
rc/1.108.0from
litellm_test_658117
Nov 2, 2026
Merged

yuneng-berri merged 3 commits into
rc/1.108.0from
litellm_test_658117

Conversation

@yuneng-berri

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • Five integration tests fail intermittently on rc/1.108.0
  • All five are test bugs, and main has the same flakes or already fixed them

How it solves it:

This should merge after #49554 lands on main. No product code changes

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 ba18de8. The scope is test files and one test config under tests/integration, with no product code, so there is no user request to replay. Each test ran one node at a time through tests/integration/run.py against native Postgres and Redis, at this branch and at rc's tip

Before (8f3af1b)

Disconnect scan

  1. Integration run 41268415473 on rc with fix(proxy): keep a retried /v1/messages stream's spend log by logging the superseded attempt as a failure #45136
  2. test_client_disconnect_before_any_content_sends_no_response_scan failed with AssertionError: (('success',),)

Logging-only scope guardrail leak

  1. Insert a default-on guardrail as H7 and H9 do, clean it up with the old SQL delete, then send an A2A message to the same gateway
  2. A2A requests kept failing for 8.2s after the cleanup

MCP keep-alive

  1. Main's MCP client against the SSE test peer, pausing 1.000s between initialize and tools/call, 30 calls
  2. 11 of 30 calls hung, each with the gateway's post_writer ReadError

Prisma migration lock

  1. Hold Prisma's advisory key in a second database and run the lock tests against the first
  2. The "leaves nothing behind" check fails because it also sees the other database's lock

Wedged Redis customer update

  1. Integration run 41268415473
  2. /customer/update took 1.340s with a wedged coordination Redis, against the 0.75s bound

After (ba18de8)

Disconnect scan

  1. Same test, 3 runs
  2. 3 of 3 passed, so rc writes the spend row while the upstream is still held, as on main

Logging-only scope guardrail leak

  1. Same sequence with the new cleanup through DELETE /guardrails/{id}
  2. The next A2A request succeeded right away, and test_logging_only_scope_config.py plus X2 passed 37 of 37

MCP keep-alive

  1. Same repro, 30 calls
  2. 0 of 30 hung, and the 54 nodes that use the in-process ASGI peer passed 54 of 54

Prisma migration lock

  1. Same held-key setup, then the whole file once without it
  2. The check passes with the other database's lock held, and the file passed 4 of 4

Wedged Redis customer update

  1. The test 3 times, then once with a 1.34s worker stall injected during /customer/update, then once with a mutant where /customer/update waits on the wedged Redis
  2. 3 of 3 passed, the stalled run passed at the new 2s bound, and the mutant failed at 10.02s
  3. The proxy's coordination Redis client takes socket_timeout from the test yaml on rc

A gauntlet-mini review with five lenses found no regression. All three picks match their source commits line for line

Type

✅ Test

Caveats (if any)

Medium

  • The disconnect scan test, as fixed on main, no longer sees a scan that runs after the upstream resumes
  • The MCP integration tests no longer exercise the gateway reusing a connection the peer just closed
    • When that happens, the gateway's tool call hangs for its full timeout instead of failing fast

Low

  • The /customer/update and burst checks now allow up to 2s, the shortest wait the proxy puts on Redis
  • A failing guardrail cleanup now raises from the test's finally, which can hide the test's own failure
  • Still red on rc with no test-side fix

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

yucheng-berri and others added 3 commits October 31, 2026 21:15
…before reading its spend row (#47303)

test_client_disconnect_before_any_content_sends_no_response_scan released the gated upstream right after
the client closed, so the upstream's next chunk raced the disconnect into the proxy. When the chunk won,
the proxy had " tail" on record for the client and the cut-short scan recorded a post_call success on
the spend row, which the test asserts is absent (CircleCI integration-extensions job 2263560 on
68db022: `AssertionError: (('success',),)`).

The test now reads the spend row first, which is written once the proxy has settled the disconnect, and
releases the upstream after it. The proxy's behavior is unchanged; only the test's ordering is.

Co-authored-by: yucheng-berri <293926326+yucheng-berri@users.noreply.github.com>
(cherry picked from commit 89a194b)
…to rc/1.108.0

Takes only #47108's (e85cb40) changes to coordination_redis_proxy_config.yaml and test_user_updates_wedged_coordination_redis.py. They set the coordination Redis socket timeout and define the shortest Redis wait bound that #49554's /customer/update fix uses
Scope the Prisma migration lock test's advisory lock check to its own database, so a lock another xdist worker holds in its database no longer trips it

Keep in-process MCP peers' idle connections open for 30s instead of 1s, so the gateway's pooled HTTP client doesn't reuse a connection the peer is closing and hang the tool call

Delete database guardrails in the logging-only scope tests through DELETE /guardrails/{id} on the shared gateway instead of raw SQL, so a default-on guardrail stops applying to the next test on the same worker right away

Bound the wedged coordination Redis /customer/update check by the shortest Redis wait the proxy uses, like the burst check, so a slow runner can't fail it while a handler that waits on Redis still does

(cherry picked from commit 4f2c75d)
@yuneng-berri
yuneng-berri requested a review from a team November 1, 2026 04:29
@yuneng-berri
yuneng-berri merged commit 5e0ddfd into rc/1.108.0 Nov 2, 2026
3 checks passed
@yuneng-berri
yuneng-berri deleted the litellm_test_658117 branch November 2, 2026 17:23
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.

3 participants