Repository navigation
test(ci): fix six CircleCI test regressions on main - #44429
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
bugbot run |
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
bugbot run |
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
bugbot run |
… launch tests Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
bugbot run |
There was a problem hiding this comment.
✅ 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.
TLDR
Problem this solves:
mainred in the last 3 scheduled runs, plus a leakmainmerges exposedHow it solves it:
unit: importingtests/unit/proxy/test_custom_proxy.pyno longer setsSERVER_ROOT_PATHunit: auth tests patch the CLI token lifetime instead of reloadingauth_checksunit: gateway launch test restores the proxy lifespan it wraps on importproxy_store_model_in_db_tests: MCP edit test now provides the stored record it readsintegration-providers: Bedrock peer helpers defer annotations so Python 3.12 can collect theme2e_ui_testingande2e_ui_testing_server_root_path: Logs page landmark is now its "Request Logs" tabFailures and causes
Red on
mainin scheduled pipelines 90795, 90799 and 90802 (checkoutf445e466b4era tip), workflows build_and_test and integrationunit(job 2237917): six tests intests/unit/proxy/agent_endpoints/test_a2a_endpoints.py, e.g.test_get_agent_card_uses_proxy_base_url_when_setandtest_get_extended_agent_card_rewrites_url, see/my-custom-pathin every URL. Culprit is a76b59d (#44015), which movedtest_custom_proxy.pyintotests/unit/proxy. That file has no tests but setsos.environ["SERVER_ROOT_PATH"]at import time, and-n 4 --dist=loadscopenow runs it in the same worker as the A2A tests (moved there by #44006). The demo server setup now lives in abuild_app()that only__main__callsunitalso failstests/unit/proxy/management_endpoints/test_team_default_params.py::TestNewTeamDefaultParamsApplied::test_nonexistent_default_organization_returns_400with 500 instead of 400. An autouse fixture intests/unit/proxy/auth/test_auth_checks_object_access_and_lookup.pyreloadedlitellm.proxy.auth.auth_checksaround every test, which mints a newOrganizationNotFoundErrorclass whileteam_endpointsstill 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 patchauth_checks.CLI_JWT_EXPIRATION_HOURSdirectlyunitalso failed on this branch after mergingmain(pipeline 90810, job 2238312) with 96 route 404s intest_proxy_setting_endpoints.py,test_routes_misc.pyandtest_organization_endpoints.py::test_v2_update_route_is_public_in_openapi, all on worker gw2.tests/unit/gateway/test_launch.pyimportedgateway.mainat 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, heretest_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, somaincan go red the same way. The test now importsgateway.maininside the one test that needs it and letsmonkeypatchrestore the lifespan and the DB env vars, the same isolationtest_component_allowlists.pyalready usesproxy_store_model_in_db_tests(job 2237922):tests/store_model_in_db_tests/test_mcp_servers.py::test_edit_mcp_server_redacts_credentialsraises503: 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 setstransport. The test's plainMockPrisma client made the read throw. The test now patchesget_mcp_serverwith a real stored record and asserts it was awaited with the server id, keeping every existing assertionintegration-providers(job 2237900): collection errors intests/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.pyandtests/integration/messages_endpoint/providers/bedrock/test_bedrock_messages_gpt_chat_completions_wire.pywithTypeError: type 'Synchronized' is not subscriptable. Culprit is 233db9f (#44307), which annotatedSynchronized[int]intests/integration/_support/bedrock_runtime_peer.pyand the chaos test. CircleCI runs Python 3.12, which evaluates those annotations eagerly. Both files now usefrom __future__ import annotations, like 48 other files intests/integration. The collection errors aborted the whole job onmain, so they hid four older failures that now show up and are deferred belowe2e_ui_testing(job 2237928) ande2e_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 entryDeferred to a later run:
integration-providersstill failstest_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_liveandtests/integration/routing/test_stale_cost_map_boot.py::test_config_deployment_dropped_by_stale_boot_cost_map_is_restored_after_reload, whichmainnever reached.logging_testing(test_async_gcs_pub_sub_v1) is already covered by #44368.integration-managementandintegration-management-replica(test_provider_errors_reach_the_caller_and_other_models_keep_mapping) andintegration-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_testingandlitellm_router_unit_testingcarry several separate or newer causes and stay red here exactly as onmain. The GitHubproxy-behaviorcheck is red onmaintoo, from aNameErrorinlitellm/proxy/lens/inference.pythat #44430 fixesPre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
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@greptileaito 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_testingande2e_ui_testing_server_root_path, cleared the A2A failures inunitand the collection errors inintegration-providers. 90808 at 1255582 passedunitandllm_translation_testing. 90810 at a3bc661, after mergingmain, exposed the gateway lifespan leak inunit. 90821 at 33f74e6 passedunitwith zero failures (the A2A, route 404 and team default org tests included),proxy_store_model_in_db_tests,e2e_ui_testingande2e_ui_testing_server_root_path, andintegration-providerscollects every Bedrock file. Every job still red there is equally red onmainin scheduled pipeline 90816 and listed as deferred aboveEach fix was mutation checked: putting the import time
SERVER_ROOT_PATHback 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 autouseauth_checksreload turns the team default org test into a 500 again. Dropping the lifespan restore intest_launch.pybrings back the 404 on the settings route after the health test. Reversing the env var precedence or default inlitellm/constants.pyfails the newtests/unit/test_constants.pycasesType
✅ 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