[Test] UI - Unit tests: raise global vitest timeout and remove per-test overrides#25468
[Test] UI - Unit tests: raise global vitest timeout and remove per-test overrides#25468yuneng-berri merged 3 commits intomainfrom
Conversation
…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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR reduces UI test flakiness by raising the global
Confidence Score: 5/5Safe 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.
|
| 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]
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.
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-
waitForoverrides.This PR:
testTimeoutinui/litellm-dashboard/vitest.config.tsfrom 10000ms to 30000ms.it/per-describetimeout arguments across UI test files so every test uses the single global value.CreateUserButtonandTeamInfotests (the two most flaky suites) under nesteddescribeblocks 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: 10000→testTimeout: 30000.CreateUserButton.test.tsx,TeamInfo.test.tsx,OldTeams.test.tsx,create_mcp_server.test.tsx,add_model_tab.test.tsx, andModelsAndEndpointsView.test.tsx.CreateUserButton.test.tsxandteam/TeamInfo.test.tsxinto nesteddescribeblocks.Testing
npm run testinui/litellm-dashboard: 380 test files, 3750 tests, all passing.Type
✅ Test