mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-29 06:33:28 +00:00
_reset_expired_window dropped the parsed offset with .replace(tzinfo=None), so a "+08:00" boundary was read as wall-clock and compared against a UTC now, delaying every non-UTC reset by the offset. compute_budget_reset_at writes those offsets itself whenever the configured budget timezone is not UTC. Keep the offset via _as_utc, which only fills in a tzinfo for legacy naive rows, and take `now` as an aware UTC datetime so the comparison is offset-aware on both sides. Rebased onto the current staging tip, where the surrounding job has been restructured: the two edits are re-applied to the current file rather than replayed, and the other three utcnow() sites belong to the key/user/team chunk resets this PR deliberately does not touch. Signed-off-by: Vineeth Sai <vineethsai4444@gmail.com> test(proxy): pass the new _reset_expired_window arguments Upstream added prisma_client, entity_type and entity_id so the reset can roll the window's LiteLLM_BudgetWindowSpend row. The two call sites in TestBudgetWindowResetAtOffsets still used the old signature and raised TypeError. The row roll is best effort inside its own try, so a MagicMock client exercises the reset decision without a database. tests/test_litellm/proxy/common_utils/test_reset_budget_job.py: 140 passed. |
||
|---|---|---|
| .. | ||
| _support | ||
| audio_tests | ||
| base_sdk_tests | ||
| benchmarks | ||
| code_coverage_tests | ||
| documentation_tests | ||
| e2e | ||
| e2e_harness | ||
| fixtures | ||
| harness_e2e | ||
| integration | ||
| rust-python-harness | ||
| test_litellm_rust | ||
| typing | ||
| unit | ||
| windows_tests | ||
| __init__.py | ||
| _fake_openai_endpoint_server.py | ||
| _flush_vcr_cache.py | ||
| _live_test_helpers.py | ||
| _master_key.py | ||
| _openai_record_replay_proxy.py | ||
| _process_helpers.py | ||
| _vcr_conftest_common.py | ||
| _vcr_redis_persister.py | ||
| _wait_helpers.py | ||
| _ws_vcr.py | ||
| AGENTS.md | ||
| capturing_transport.py | ||
| eval_swe_bench.py | ||
| fake_openai_endpoint.py | ||
| gettysburg.wav | ||
| large_text.py | ||
| openai_batch_completions.jsonl | ||
| pyrightconfig.json | ||
| README.MD | ||
| test_logging.conf | ||
| test_rust_python_harness.py | ||
| VCR_TESTING.md | ||
| white_100x100.png | ||
In total litellm runs 1000+ tests
[02/20/2025] Update:
To make it easier to contribute and map what behavior is tested,
we've started mapping the litellm directory in tests/unit
This folder can only run mock tests.