Skip to content

test(configuration): restore isolated gateway launcher imports - #51848

Merged
mateo-berri merged 1 commit into
mainfrom
litellm_flakeheal_20261114_test_gateway_launcher_logs_the_real_clie
Nov 14, 2026
Merged

mateo-berri merged 1 commit into
mainfrom
litellm_flakeheal_20261114_test_gateway_launcher_logs_the_real_clie

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Handwritten 1-3 sentence description

Restore the gateway launcher tests after the runtime source move so they can check real client addresses behind Rust again. Keep isolated Python and the existing worker command and access log assertions

Details

TLDR

Problem this solves

  • Isolated Python cannot find the relocated gateway module

How it solves it

  • Add the owned runtime directory to the isolated launch command
  • Reuse that command unchanged in the supervised child

CI evidence

times_failed=2 for the covered test in https://github.com/BerriAI/litellm/actions/runs/43614386285/job/132506140919

After #51006, gateway.launch lives below litellm/runtime. The harness uses -I, which ignores PYTHONPATH. A gateway-only bootstrap adds that owned source directory and runs the same module. The regular proxy command and all assertions stay unchanged

Pre-Submission checklist

  • Existing behavioral assertions preserved and mutation checked
  • Both parameter variants pass five times
  • Whole test file and shared harness traffic tests pass
  • Local make lint passes
  • One isolated harness import fix
  • Remote CI and automated reviews, no PR opened

Screenshots / Proof of Fix

E2E exception at f00d8d7

Test harness import correction only, with real Rust forwarding and two Python workers. Tests also prove the supervised child retains the supervisor's isolated interpreter command. Rebase only added unrelated Bedrock vector store changes and preserved this diff

Setup used sudo service postgresql start, local Redis, and the workflow's Rust gateway build from litellm/packaging/litellm-proxy

CARGO_INCREMENTAL=0 uv run --no-project --with maturin==1.15.0 maturin build --profile dev --strip --out /home/ubuntu/scratchpad/heal-gateway-dist
uv pip install --no-deps --python ../../../.venv/bin/python /home/ubuntu/scratchpad/heal-gateway-dist/*.whl

The first fixed run found the local gateway binary missing, so it failed the explicit no-fallback assertion. Installing it exactly as the workflow does resolved that environment gap before the five runs below. No assertion was bypassed

All runner commands used DATABASE_URL=postgresql://postgres:postgres@127.0.0.1:5432/circle_test REDIS_HOST=127.0.0.1 REDIS_PORT=6379 INTEGRATION_WORKERS=2, with retries disabled

uv run --no-sync python tests/integration/run.py management tests/integration/configuration/test_rust_forward.py::test_gateway_launcher_logs_the_real_client_address_behind_rust

Unchanged origin/main, gateway import never reached readiness

======================== 2 failed in 262.73s (0:04:22) =========================

Same command after the fix and workflow binary setup

======================== 2 passed in 144.03s (0:02:24) =========================
======================== 2 passed in 104.84s (0:01:44) =========================
========================= 2 passed in 98.23s (0:01:38) =========================
========================= 2 passed in 90.97s (0:01:30) =========================
======================== 2 passed in 100.16s (0:01:40) =========================

Whole file plus the other shared harness consumer

uv run --no-sync python tests/integration/run.py management tests/integration/configuration/test_rust_forward.py tests/integration/configuration/test_rust_forward_traffic.py
======================== 13 passed in 181.59s (0:03:01) ========================

Mutation, temporarily return immediately from _restore_peer and run the targeted command above. Access logs report the loopback or spoofed address instead of the real client, and both parameter variants fail

E   AssertionError: ('INFO:     198.51.100.10:0 - "GET /health/liveliness?client-ip-proof HTTP/1.1" 200 OK',)
E   AssertionError: ('INFO:     127.0.0.1:33286 - "GET /health/liveliness?client-ip-proof HTTP/1.1" 200 OK',)
========================= 2 failed in 87.78s (0:01:27) =========================

The mutation was reverted exactly before committing

make lint exited 0

0 errors, 0 warnings, 0 notes
OK: no strict rule grew past its merge-base count (base origin/main)
OK: no LIT rule grew past its merge-base count (base origin/main)
OK: no TQ rule grew past its merge-base count (base origin/main)
OK: no OA rule grew past its merge-base count (base origin/main)
OK: every basedpyright rule is within its ceiling (94676 errors total, base ec48e2491c51)

Type

Test

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

@mateo-berri mateo-berri 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.

LGTM

@mateo-berri
mateo-berri enabled auto-merge (squash) November 14, 2026 19:00
@veria-ai

veria-ai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

PR overview

No security issues were found in this pull request.

Reviews

@mateo-berri
mateo-berri merged commit bba6f49 into main Nov 14, 2026
91 checks passed
@mateo-berri
mateo-berri deleted the litellm_flakeheal_20261114_test_gateway_launcher_logs_the_real_clie branch November 14, 2026 19:14
@codecov

codecov Bot commented Nov 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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