mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-08 03:08:45 +00:00
* test(e2e): budget reset diagonal for team, org, user, and #32005 team-member keys Adds E2E-7/8/10/11 from the budget-level x key-kind coverage matrix: each budget level serves traffic again after its budget_duration window elapses, walking the same ladder as the enforcement diagonal. New registry rows and tests cover the team, organization, and internal-user reset rungs, plus the #32005 interplay where a team-member key frozen by its owner's user budget comes back when the user's window renews; the bare-key and per-team-member rungs already had coverage Each case isolates the cap to one entity, drives spend to a budget_exceeded block, then polls past the window until a call succeeds, holding every refusal as a budget block so a reset that no-ops (stays blocked forever) or crashes (leaks a 5xx) fails the test. budget_duration becomes an optional param on the budget_client create_team / create_user / create_org helpers * test(e2e): fold the reset diagonal into test_budget_reset_e2e.py and address greptile nits Move the team / org / user / #32005 reset cases out of the standalone test_budget_reset_diagonal_e2e.py and into test_budget_reset_e2e.py, absorbing the pre-existing bare-key reset into the same TestBudgetResetDiagonal spec class so the whole reset ladder reads as one file (mirroring how the enforcement diagonal lives in test_budget_enforcement_e2e.py) and the drive/poll helpers are defined once instead of duplicated across reset files. Greptile nits: bound the drive phase to under one window (12 attempts x 2s < 30s) so a block is observed before the reset job can fire, and replace the bare assert in the poll loop with a pytest.fail that prints the HTTP status, so a provider 429 or a crashed reset path is distinguishable from a budget block at a glance. * test(e2e): trim reset diagonal docstrings back to the file's original style * test(e2e): inline single-use drive-loop bounds * test(e2e): cut the reset module docstring to one line * test(e2e): make the org reset test wait for a scheduled window (bugbot) /organization/new stores budget_duration without scheduling budget_reset_at, so the reset job's NULL catch-up branch zeroes org spend on its first 5-10s tick; the org reset test could pass off that catch-up instead of a real window roll (tracked as LIT-4570). The test now reads the org's budget_id and polls /budget/info until budget_reset_at is scheduled before driving spend, so the recovery it observes can only come from a genuine window expiry. Verified live: the org case now runs ~33s (a full window) instead of beating the rescheduler |
||
|---|---|---|
| .. | ||
| budgets | ||
| ratelimit | ||
| spend_tracking | ||