mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-02 20:22:10 +00:00
The spend accuracy tests were flaky because they used fixed sleeps (45s/30s) to wait for the batch writer to flush. Under CI load, the batch writer scheduler can be delayed beyond these windows, causing all spend values to remain 0.0 and the test to fail. Replace fixed sleeps with a polling loop that checks key spend every 10s for up to 120s, only proceeding once spend becomes non-zero. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>