Skip to content

test(e2e): bring the redis chaos load test and its config to main - #40876

Closed
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
litellm_redis_chaos_test_to_main
Closed

devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
litellm_redis_chaos_test_to_main

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • project-releaser add support for j2 instruct models  #238 makes e2e-redis-chaos a release-blocking rc gate
  • the gate runs load/test_redis_chaos_e2e.py from the runner image built at the candidate SHA
  • main has neither the chaos config nor the test, so the gate fails on main HEAD
  • staging is ~275 commits ahead, so a full promotion is not the right vehicle before the release

How it solves it:

  • snapshots the chaos test and its file closure from litellm_internal_staging onto main
  • config tests/e2e/gateway/redis_chaos_ci_config.yml, the load/ helpers, the redis_chaos marker, psutil in e2e-dev
  • hand-ports only the shared-module symbols the test imports, leaving unrelated staging work (JWT/Keycloak, memory tests) out

User Flow

Before: a release operator cuts an rc and the release gate goes red on the chaos step

  1. They run the rc pipeline in project-releaser against main HEAD
  2. The e2e-redis-chaos step exits 1 with "This runner image carries no redis chaos config (its litellm revision predates the test)"
  3. Promotion is blocked with reason chaos-not-passed

After: the same rc run builds a runner image that carries the config and the test

  1. They run the rc pipeline against main HEAD with this PR merged
  2. The chaos sidecar boots the proxy from redis_chaos_ci_config.yml, the runner runs load/test_redis_chaos_e2e.py and reports its verdict
  3. Promotion proceeds when both e2e-run and e2e-redis-chaos pass

Relevant issues

Companion to BerriAI/project-releaser#238. The test itself landed on staging in #40482

Linear ticket

Pre-Submission checklist

  • I have added meaningful tests
  • The handful of test files covering my change pass locally: uv run --no-sync pytest tests/e2e/load/test_phase_budget.py tests/e2e/load/test_proxy_usage.py tests/e2e/load/test_locust_load.py (41 passed), coverage registry tests (13 passed), E2E_REDIS_CHAOS=1 ... --collect-only collects the chaos test and it is deselected without the env var
  • 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
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review

Screenshots / Proof of Fix

No proxy behavior changes here; this PR only ships test code and a test config to main. The end-to-end proof is the rc pipeline's e2e-redis-chaos step in project-releaser going from the "carries no redis chaos config" exit 1 to an actual test run once the runner image is built from a main SHA that includes this PR

Type

✅ Test
🚄 Infrastructure

Caveats (if any)

Medium

  • This ships the test but does not guarantee main passes it; the gate will tell us. The breaker and spend-tracking fixes the test was written against are on staging and only partly on main
  • Files are snapshotted from staging, so the eventual staging-to-main promotion should see them as already present rather than conflicting; models.py, e2e_config.py, conftest.py were hand-ported and may show trivial merge overlap

Low

  • .github/workflows/test-e2e-redis-chaos.yml is included so the same test can be run by hand from main via workflow_dispatch; it is not wired to any trigger on main

QA runbook

  • tests/e2e/load/test_redis_chaos_e2e.py::TestRedisChaos::test_load_survives_redis_being_down - the proxy keeps answering every request with zero failures while its Redis is paused, and stays within RSS, CPU, latency and log-volume ceilings
    • Start Postgres and Valkey locally, then uv run --no-sync litellm --config tests/e2e/gateway/redis_chaos_ci_config.yml --port 4000 --num_workers 4, note the master PID and log path
    • E2E_REDIS_CHAOS=1 E2E_PROXY_PID=<pid> E2E_PROXY_LOG=<log> LITELLM_PROXY_URL=http://localhost:4000 REDIS_HOST=127.0.0.1 REDIS_PORT=6379 uv run --no-sync pytest tests/e2e/load/test_redis_chaos_e2e.py -v -s
    • Expect the test to register mock deployments through POST /model/new, run a healthy locust phase, issue CLIENT PAUSE ALL on Redis, run the chaos phase and report zero failed requests on /chat/completions and /v1/messages
    • Sanity check: this test makes sense to add and is not hand-wavey or potentially flaky

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

Link to Devin session: https://app.devin.ai/sessions/84a7fe278ae44c09a9b0b4ed67fe4506
Open in Devin Desktop: https://app.devin.ai/desktop/session/84a7fe278ae44c09a9b0b4ed67fe4506?variant=devin

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration
devin-ai-integration Bot changed the base branch from litellm_internal_staging to main September 12, 2026 18:37
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.

1 participant