mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-14 04:09:09 +00:00
* test(unit): wait on the work itself instead of fixed sleeps in 21 flaky files Replace sleeps that raced background logging, cache writes, refreshes and thread work with either awaiting that work directly (logging worker flush, the batch logger's flush_queue, the tasks the call spawned, thread joins) or an Event the test's own fake sets when it runs. Each wait keeps a 5s hang guard that never decides pass or fail. Tests that need a fake clock, real sockets, or measure latency are left unchanged, and no production code moves * test(unit): await the tasks each completion spawns instead of yielding once The logging tests yielded once with asyncio.sleep(0) so the task that enqueues the success log could run before the worker flush. That relied on the enqueue happening before the task's first await. Snapshot the running tasks around each acompletion call and await the ones it spawned, so the guarantee holds however many steps sit before the enqueue |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_agents_http_handler.py | ||
| test_agents_main_and_utils.py | ||
| test_background_cost_polling.py | ||
| test_gemini_interactions_transformation.py | ||
| test_interactions_streaming_iterator.py | ||
| test_litellm_responses_bridge.py | ||
| test_main.py | ||
| test_openapi_compliance.py | ||