Skip to content

test: repair two CI tests broken by intentional changes - #39932

Merged
yuneng-berri merged 1 commit into
litellm_internal_stagingfrom
litellm_/circleci-pipeline-failure-afe848
Sep 5, 2026
Merged

yuneng-berri merged 1 commit into
litellm_internal_stagingfrom
litellm_/circleci-pipeline-failure-afe848

Conversation

@yuneng-berri

@yuneng-berri yuneng-berri commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

How it solves it:

  • Rename the allowlist entry to auto_router_capability_violation
  • Select 50 rows per page before counting, as the Logs case already does

User Flow

No user-facing change. Both edits are to tests only

Relevant issues

Linear ticket

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/test_litellm/<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)

Screenshots / Proof of Fix

Before (9878436)

test_no_linear_scans_in_router

  1. CircleCI litellm_router_unit_testing on the last staging-bound run: https://app.circleci.com/pipelines/gh/BerriAI/litellm/89202/workflows/2e9c2960-9fd4-4cba-bf73-5acb3101ca4f
  2. Observed: Found O(n) linear scan pattern in router.py: auto_router_capability_violation() at line 8815. The allowlist still names the pre-rename heuristic_v2_router_limit_violation

Tags and Model Hub scrolling specs

  1. CircleCI e2e_ui_testing on the same workflow
  2. Observed: both Tags: no row paints past the box it lives in and Model Hub: no row paints past the box it lives in fail with Expected: >= 40, Received: 25 after three attempts. The tables now page at 25

After (da5af0c)

test_no_linear_scans_in_router

  1. python -m pytest tests/router_unit_tests/test_router_index_management.py -k test_no_linear_scans_in_router -q
  2. Observed: 1 passed, 8 deselected in 1.03s
  3. CircleCI litellm_router_unit_testing on this PR reports the same test as success (5.98s)

Tags and Model Hub scrolling specs

  1. Brought the UI e2e stack up with E2E_KEEP_ALIVE=1 ./run_e2e.sh from tests/e2e/ui (seeded postgres, mock LLM on 8090, proxy on 4000 serving the UI built from this branch)
  2. E2E_UI_BASE_URL=http://localhost:4000 LITELLM_MASTER_KEY=sk-1234 PROXY_LOGOUT_URL=https://www.example.com MOCK_LLM_PORT=8090 npx playwright test --config playwright.config.ts tests/tables/tableScrolling.spec.ts -g "Tags|Model Hub"
  3. Observed: 2 passed (28.2s)
  4. CircleCI e2e_ui_testing on this PR: 139 passed (9.6m), and the whole build_and_test workflow succeeded: https://app.circleci.com/pipelines/github/BerriAI/litellm?branch=litellm_%2Fcircleci-pipeline-failure-afe848

Type

✅ Test

Caveats (if any)

QA runbook

  • tests/e2e/ui/tests/tables/tableScrolling.spec.ts › Tags: no row paints past the box it lives in - with 40 tags and the page size raised to 50, every row stays inside the table's own scroll box

    • Create 40 tags: for i in $(seq 1 40); do curl -s -X POST http://localhost:4000/tag/new -H "Authorization: Bearer sk-1234" -H "Content-Type: application/json" -d "{\"name\": \"scroll-tag-$i\"}"; done
    • Open http://localhost:4000/ui/?page=tag-management, set the rows-per-page selector in the table footer to 50
    • Expect at least 40 rows in the table, none of them painting below the bottom edge of the table body or of the page
    • Sanity check: this test makes sense to add and is not hand-wavey (e.g., assert actual expected spend instead of just spend > 0) or potentially flaky
  • tests/e2e/ui/tests/tables/tableScrolling.spec.ts › Model Hub: no row paints past the box it lives in - same check on the Model Hub table with 40 models

    • Create 40 models: for i in $(seq 1 40); do curl -s -X POST http://localhost:4000/model/new -H "Authorization: Bearer sk-1234" -H "Content-Type: application/json" -d "{\"model_name\": \"scroll-model-$i\", \"litellm_params\": {\"model\": \"openai/fake-gpt-4\", \"api_base\": \"http://127.0.0.1:8090/v1\", \"api_key\": \"fake-key\"}}"; done
    • Open http://localhost:4000/ui/?page=model-hub-table, set the rows-per-page selector to 50
    • Expect at least 40 rows, none painting past the table body or the page
    • Sanity check: this test makes sense to add and is not hand-wavey (e.g., assert actual expected spend instead of just spend > 0) 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

test_no_linear_scans_in_router: #39674 renamed heuristic_v2_router_limit_violation
to auto_router_capability_violation, so the allowlist entry stopped matching and the
same admin-only scan tripped the static check. Rename the entry to follow it.

tableScrolling.spec.ts: 9ba6cab (LIT-4738) gave the Tags and Model Hub tables
client-side pagination at 25 rows, so the 40 seeded rows no longer render on one
page. Select 50 rows per page before counting, as the Logs case already does.
@yuneng-berri
yuneng-berri requested a review from a team September 5, 2026 19:03
@greptile-apps

greptile-apps Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR repairs two test suites after intentional production changes

  • Updates the router linear-scan allowlist to reference the renamed capability-check method
  • Selects a 50-row page before validating the 40 seeded rows in the Tags and Model Hub scrolling tests

Confidence Score: 5/5

The PR appears safe to merge because both changes preserve the tests' intended coverage after the underlying behavior changed

The pagination helper targets controls shared by both affected tables, and the router allowlist now matches the renamed method while preserving the previous exception

Important Files Changed

Filename Overview
tests/e2e/ui/tests/tables/tableScrolling.spec.ts Selects a supported 50-row page so both scrolling tests render and inspect all 40 seeded records
tests/router_unit_tests/test_router_index_management.py Updates the existing linear-scan exception to match the renamed router method without broadening the allowlist

Reviews (1): Last reviewed commit: "test: repair two CI tests broken by inte..." | Re-trigger Greptile

@codecov

codecov Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@yuneng-berri
yuneng-berri merged commit 730d789 into litellm_internal_staging Sep 5, 2026
218 of 222 checks passed
@yuneng-berri
yuneng-berri deleted the litellm_/circleci-pipeline-failure-afe848 branch September 5, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants