Skip to content

test(ci): fix six CircleCI test regressions on main - #44429

Merged
mateo-berri merged 5 commits into
mainfrom
litellm_circleci_heal_test_drift_1003
Oct 4, 2026
Merged

mateo-berri merged 5 commits into
mainfrom
litellm_circleci_heal_test_drift_1003

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • Five CircleCI jobs on main red in the last 3 scheduled runs, plus a leak main merges exposed
  • All five causes are tests that drifted behind intentional changes or leaked state
  • No runtime code is wrong, so this PR touches tests only

How it solves it:

  • unit: importing tests/unit/proxy/test_custom_proxy.py no longer sets SERVER_ROOT_PATH
  • unit: auth tests patch the CLI token lifetime instead of reloading auth_checks
  • unit: gateway launch test restores the proxy lifespan it wraps on import
  • proxy_store_model_in_db_tests: MCP edit test now provides the stored record it reads
  • integration-providers: Bedrock peer helpers defer annotations so Python 3.12 can collect them
  • e2e_ui_testing and e2e_ui_testing_server_root_path: Logs page landmark is now its "Request Logs" tab

Failures and causes

Red on main in scheduled pipelines 90795, 90799 and 90802 (checkout f445e466b4 era tip), workflows build_and_test and integration

unit (job 2237917): six tests in tests/unit/proxy/agent_endpoints/test_a2a_endpoints.py, e.g. test_get_agent_card_uses_proxy_base_url_when_set and test_get_extended_agent_card_rewrites_url, see /my-custom-path in every URL. Culprit is a76b59d (#44015), which moved test_custom_proxy.py into tests/unit/proxy. That file has no tests but sets os.environ["SERVER_ROOT_PATH"] at import time, and -n 4 --dist=loadscope now runs it in the same worker as the A2A tests (moved there by #44006). The demo server setup now lives in a build_app() that only __main__ calls

unit also fails tests/unit/proxy/management_endpoints/test_team_default_params.py::TestNewTeamDefaultParamsApplied::test_nonexistent_default_organization_returns_400 with 500 instead of 400. An autouse fixture in tests/unit/proxy/auth/test_auth_checks_object_access_and_lookup.py reloaded litellm.proxy.auth.auth_checks around every test, which mints a new OrganizationNotFoundError class while team_endpoints still catches the old one. The two files only share a worker since the test moves in #44003 (73072b8). The fixture is gone, and the two CLI token expiry tests that needed it now patch auth_checks.CLI_JWT_EXPIRATION_HOURS directly

unit also failed on this branch after merging main (pipeline 90810, job 2238312) with 96 route 404s in test_proxy_setting_endpoints.py, test_routes_misc.py and test_organization_endpoints.py::test_v2_update_route_is_public_in_openapi, all on worker gw2. tests/unit/gateway/test_launch.py imported gateway.main at module scope, which wraps the shared proxy app's lifespan with the gateway route trim at collection time in every xdist worker. The next test that starts the app lifespan, here test_health_endpoints.py::test_health_backlog_includes_admission_control_stats, cut the shared route table from 628 to 214 routes. The import arrived in unit runs with #42902 (bf01870), and whether a worker hits it depends on how tests split across shards, so main can go red the same way. The test now imports gateway.main inside the one test that needs it and lets monkeypatch restore the lifespan and the DB env vars, the same isolation test_component_allowlists.py already uses

proxy_store_model_in_db_tests (job 2237922): tests/store_model_in_db_tests/test_mcp_servers.py::test_edit_mcp_server_redacts_credentials raises 503: Cannot validate MCP configuration while stored state is unavailable. Culprit is 04bc354 (#44232), which made the edit endpoint read the stored server and deliberately fail closed when that read fails and the payload sets transport. The test's plain Mock Prisma client made the read throw. The test now patches get_mcp_server with a real stored record and asserts it was awaited with the server id, keeping every existing assertion

integration-providers (job 2237900): collection errors in tests/integration/providers/test_bedrock_gpt_responses_native_wire.py, test_bedrock_runtime_chat_completions_chaos.py, test_bedrock_runtime_chat_completions_sad_wire.py, test_bedrock_runtime_chat_completions_wire.py and tests/integration/messages_endpoint/providers/bedrock/test_bedrock_messages_gpt_chat_completions_wire.py with TypeError: type 'Synchronized' is not subscriptable. Culprit is 233db9f (#44307), which annotated Synchronized[int] in tests/integration/_support/bedrock_runtime_peer.py and the chaos test. CircleCI runs Python 3.12, which evaluates those annotations eagerly. Both files now use from __future__ import annotations, like 48 other files in tests/integration. The collection errors aborted the whole job on main, so they hid four older failures that now show up and are deferred below

e2e_ui_testing (job 2237928) and e2e_ui_testing_server_root_path (job 2237932): tests/e2e/ui/tests/migration/migratedPages.spec.ts "logs: sidebar nav, reload, and round-trip via the api-keys landing" waits for a "Request Logs" heading. Culprit is 4b9f990 (#44306), whose stated intent is to remove the duplicate Logs headings, so the page now shows "Request Logs" as its first tab. The fixture now expects that tab, matching the existing Logging & Alerts entry

Deferred to a later run: integration-providers still fails test_bedrock_stream_timeout_wire.py::test_c8_the_bedrock_passthrough_stream_already_retries_at_the_deployment_timeout, test_bedrock_stream_timeout_chaos.py::test_x1_thirty_stalled_streams_across_every_endpoint_each_time_out_while_the_proxy_stays_live and tests/integration/routing/test_stale_cost_map_boot.py::test_config_deployment_dropped_by_stale_boot_cost_map_is_restored_after_reload, which main never reached. logging_testing (test_async_gcs_pub_sub_v1) is already covered by #44368. integration-management and integration-management-replica (test_provider_errors_reach_the_caller_and_other_models_keep_mapping) and integration-database-replica (test_migration_entrypoint_adds_the_gin_index_and_the_upgraded_proxy_maps_managed_ids) come from #43800 and need a closer look at the intended error shape. integration-cost, integration-extensions, litellm_utils_testing and litellm_router_unit_testing carry several separate or newer causes and stay red here exactly as on main. The GitHub proxy-behavior check is red on main too, from a NameError in litellm/proxy/lens/inference.py that #44430 fixes

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
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review (Greptile reviews automatically once the PR is opened; only comment @greptileai to re-request a review after pushing changes)

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

This PR changes tests only, so the proof is the previously red CircleCI jobs passing on this branch. PR branch pipelines: 90805 at 2a6a671 passed proxy_store_model_in_db_tests, e2e_ui_testing and e2e_ui_testing_server_root_path, cleared the A2A failures in unit and the collection errors in integration-providers. 90808 at 1255582 passed unit and llm_translation_testing. 90810 at a3bc661, after merging main, exposed the gateway lifespan leak in unit. 90821 at 33f74e6 passed unit with zero failures (the A2A, route 404 and team default org tests included), proxy_store_model_in_db_tests, e2e_ui_testing and e2e_ui_testing_server_root_path, and integration-providers collects every Bedrock file. Every job still red there is equally red on main in scheduled pipeline 90816 and listed as deferred above

Each fix was mutation checked: putting the import time SERVER_ROOT_PATH back fails the six A2A tests, dropping the stored record mock or forcing the read failure brings the 503 back, removing the deferred annotations brings back the five collection errors, and putting back an autouse auth_checks reload turns the team default org test into a 500 again. Dropping the lifespan restore in test_launch.py brings back the 404 on the settings route after the health test. Reversing the env var precedence or default in litellm/constants.py fails the new tests/unit/test_constants.py cases

Type

✅ Test

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

  • 33f74e6 passes /live-pr-risk

Link to Devin session: https://app.devin.ai/sessions/b4b095617ce54b7f808a68b963ed0b69
Open in Devin Desktop: https://app.devin.ai/desktop/session/b4b095617ce54b7f808a68b963ed0b69?variant=devin
Requested by: @mateo-berri

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

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@greptile-apps

greptile-apps Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Low risk] Fixes test failures in the test suite.

The PR appears safe to merge based on the reviewed changes.

Summary

This test-only PR isolates proxy and auth tests, supplies stored MCP state to the edit test, defers Bedrock test annotations, and updates the Logs page landmark. The latest change makes the gateway import test avoid import-time database and lifespan side effects and adds direct coverage for CLI token-expiry environment precedence.

Reviews (4) · Last reviewed commit: "test(gateway): restore proxy lifespan af..."

@codecov

codecov Bot commented Oct 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@mateo-berri

Copy link
Copy Markdown
Contributor

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.

Stale Bugbot comment from a previous run.

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

Copy link
Copy Markdown
Contributor

bugbot run

@devin-ai-integration devin-ai-integration Bot changed the title test(ci): fix four CircleCI regressions on main test(ci): fix five CircleCI test regressions on main Oct 3, 2026

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

Stale Bugbot comment from a previous run.

@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

Comment thread tests/unit/proxy/auth/test_auth_checks_object_access_and_lookup.py
mateo-berri and others added 2 commits October 3, 2026 22:42
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@mateo-berri

Copy link
Copy Markdown
Contributor

bugbot run

@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

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

Stale Bugbot comment from a previous run.

… launch tests

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

Copy link
Copy Markdown
Contributor

bugbot run

@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

@devin-ai-integration devin-ai-integration Bot changed the title test(ci): fix five CircleCI test regressions on main test(ci): fix six CircleCI test regressions on main Oct 4, 2026

@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 33f74e6. Configure here.

@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 merged commit cf22deb into main Oct 4, 2026
149 of 159 checks passed
@mateo-berri
mateo-berri deleted the litellm_circleci_heal_test_drift_1003 branch October 4, 2026 03:55
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