Skip to content

[Test] UI - Unit tests: raise global vitest timeout and remove per-test overrides#25468

Merged
yuneng-berri merged 3 commits intomainfrom
litellm_/compassionate-shannon
Apr 10, 2026
Merged

[Test] UI - Unit tests: raise global vitest timeout and remove per-test overrides#25468
yuneng-berri merged 3 commits intomainfrom
litellm_/compassionate-shannon

Conversation

@yuneng-berri
Copy link
Copy Markdown
Collaborator

Summary

CI is flaky because UI unit tests mix a tight 10s global timeout with a sprinkling of per-test overrides (5s–30s) and per-waitFor overrides.

This PR:

  • Raises testTimeout in ui/litellm-dashboard/vitest.config.ts from 10000ms to 30000ms.
  • Removes all per-it/per-describe timeout arguments across UI test files so every test uses the single global value.
  • Groups CreateUserButton and TeamInfo tests (the two most flaky suites) under nested describe blocks by area (rendering, submission, tabs, settings, etc.) to make failures easier to localize without splitting the files.

waitFor/findBy* internal timeouts were left alone — those control internal polling, not the test-level timeout.

Changes

  • vitest.config.ts: testTimeout: 10000testTimeout: 30000.
  • Removed per-test timeout overrides in CreateUserButton.test.tsx, TeamInfo.test.tsx, OldTeams.test.tsx, create_mcp_server.test.tsx, add_model_tab.test.tsx, and ModelsAndEndpointsView.test.tsx.
  • Reorganized CreateUserButton.test.tsx and team/TeamInfo.test.tsx into nested describe blocks.

Testing

npm run test in ui/litellm-dashboard: 380 test files, 3750 tests, all passing.

Type

✅ Test

…st overrides

Raise vitest testTimeout from 10s to 30s and drop per-test timeout overrides
across UI unit tests. Group CreateUserButton and TeamInfo tests under nested
describe blocks to make the most flaky suites easier to scan.
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment Apr 10, 2026 4:16am

Request Review

@codspeed-hq
Copy link
Copy Markdown
Contributor

codspeed-hq bot commented Apr 10, 2026

Merging this PR will not alter performance

✅ 16 untouched benchmarks


Comparing litellm_/compassionate-shannon (c7f610c) with main (42e5583)

Open in CodSpeed

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 10, 2026

Greptile Summary

This PR reduces UI test flakiness by raising the global testTimeout in vitest.config.ts from 10 s to 30 s and removing inconsistent per-test/per-describe timeout overrides across six test files. CreateUserButton.test.tsx and TeamInfo.test.tsx are also reorganized into nested describe blocks for easier failure localization, and a few new tests are added to cover previously untested paths (modal close behavior, team-member budget display, virtual-key display).

waitFor/findBy* internal polling timeouts are deliberately left in place, which is the correct distinction to make.

Confidence Score: 5/5

Safe to merge — test-only changes that strictly improve reliability without weakening any assertions.

All changes are test housekeeping: raising a global timeout, removing inconsistent per-test overrides, and reorganizing describe blocks. No assertions are weakened, new tests add coverage, and internal waitFor timeouts are correctly preserved.

No files require special attention.

Important Files Changed

Filename Overview
ui/litellm-dashboard/vitest.config.ts Raised global testTimeout from 10 000 ms to 30 000 ms; no other changes.
ui/litellm-dashboard/src/components/CreateUserButton.test.tsx Removed describe-level timeout override, reorganized tests into nested describe blocks, added 'should close modal when cancel is clicked' test — no assertions weakened.
ui/litellm-dashboard/src/components/team/TeamInfo.test.tsx Reorganized into nested describe blocks and added new rendering/display tests; all original assertions preserved.
ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/ModelsAndEndpointsView.test.tsx Removed four per-test 15 000 ms overrides; internal findByText timeout (10 000 ms) correctly retained.
ui/litellm-dashboard/src/components/OldTeams.test.tsx Removed single per-test { timeout: 30000 } override that was redundant with the new global value.
ui/litellm-dashboard/src/components/add_model/add_model_tab.test.tsx Per-test timeout overrides removed; one waitFor internal timeout (10 000 ms) correctly left in place at line 270.
ui/litellm-dashboard/src/components/mcp_tools/create_mcp_server.test.tsx Per-test timeout overrides removed; no assertions changed.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Vitest global testTimeout
30 000 ms] --> B{Per-test override?}
    B -- "Yes (before PR)" --> C[Use per-test timeout
5 000–30 000 ms]
    B -- "No (after PR)" --> D[Use global timeout
30 000 ms]
    C --> E[Inconsistent,
causes flakiness]
    D --> F[Consistent across
all test suites]
    F --> G{waitFor / findBy*
internal timeout?}
    G -- "Yes (left untouched)" --> H[Internal polling bounded
e.g. 10 000 ms]
    G -- "No" --> I[Waits up to
global timeout]
Loading

Reviews (3): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile

Remove leftover 10000ms per-test timeout in add_model_tab.test.tsx that was
missed in the initial sweep. The test now inherits the 30000ms global.
@yuneng-berri yuneng-berri merged commit 9e6d2d2 into main Apr 10, 2026
96 of 99 checks passed
@yuneng-berri yuneng-berri deleted the litellm_/compassionate-shannon branch April 10, 2026 04:35
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.

2 participants