mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-28 00:00:38 +00:00
* test(unit): make 20 flaky unit tests deterministic These tests failed on main and on PR reruns over the last two weeks without a code change. Each fix keeps what the test proves and only removes the timing, clock or shared-state dependency. Router usage tests now read usage with usage_since, because the Rust core stamps usage with its own system clock, so a read in the next minute missed the write. The header parity test checks the remaining count against the minute the header was read in. The websocket admission test pins the usage-based-routing-v2 clock, and the deployment rpm test freezes time with time-machine because its old patch never reached the clock bound as a default argument. The bedrock realtime test stubs AWS signing like its sibling. The swagger test stubs FastAPI's schema builder. The prisma span scan skips files that cannot hold a call site. The http, live session and custom code bounds are tied to the timeout constants they guard. The vertex test reads only LiteLLM log records, the agentops test reads only its own route's requests, the redis test picks a port whose shared breaker is closed, and the SAML test freezes the clock and now asserts the exact TTL. * test(bedrock): stub the boto3 session instead of our own signing helper Greptile flagged that the realtime guardrail fixture replaced run_aws_signing, which tests/unit/AGENTS.md forbids. The CI timeout was resolve_credentials building a real boto3.Session on the signing pool, so the fixture now swaps boto3.Session for a static-key session and the real signing path runs. * test(s3): keep the short upload deadline for the timeout case only The dropped-connection case also ran under the 0.3s per-attempt deadline. When the fake bucket's handler thread answered one attempt late on a loaded runner, that attempt was retried as a timeout instead of a dropped connection, so the test counted 5 PUTs instead of 6. Only the timeout case needs the short deadline. |
||
|---|---|---|
| .. | ||
| chat | ||
| completion | ||
| decisions | ||
| embeddings | ||
| evals | ||
| image_generation | ||
| image_variations | ||
| live | ||
| realtime | ||
| responses | ||
| speech | ||
| transcriptions | ||
| vector_store_files | ||
| vector_stores | ||
| videos | ||
| __init__.py | ||
| test_cost_calculation.py | ||
| test_data_residency.py | ||
| test_gpt_reasoning_transformation.py | ||
| test_is_model_gpt_5_model.py | ||
| test_o_series_transformation.py | ||
| test_openai.py | ||
| test_openai_audio_speech.py | ||
| test_openai_authentication_error.py | ||
| test_openai_common_utils.py | ||
| test_openai_empty_response.py | ||
| test_openai_file_content_streaming.py | ||
| test_openai_image_edit_transformation.py | ||
| test_openai_workload_identity.py | ||
| test_organization_costs.py | ||
| test_use_chat_completions_api_no_leak.py | ||