litellm/tests/spend_tracking_tests
yuneng-jiang 3012c6d070 fix(tests): replace fixed sleeps with polling in spend accuracy tests
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>
2026-03-13 00:06:09 -07:00
..
test_ocr_spend_tracking.py fix ocr test 2025-10-31 20:32:03 -07:00
test_spend_accuracy_tests.py fix(tests): replace fixed sleeps with polling in spend accuracy tests 2026-03-13 00:06:09 -07:00