From d19ab3b7eec89f094c87cac1e5bf17dac44b8d96 Mon Sep 17 00:00:00 2001 From: yucheng Date: Mon, 26 Oct 2026 17:48:21 -0700 Subject: [PATCH] test(proxy): move the stalled counter bound reason into the assert message --- .../spend/test_failure_spend_live_counters_chaos.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/integration/spend/test_failure_spend_live_counters_chaos.py b/tests/integration/spend/test_failure_spend_live_counters_chaos.py index 4fdd7037ac8..ecdd5aadb8e 100644 --- a/tests/integration/spend/test_failure_spend_live_counters_chaos.py +++ b/tests/integration/spend/test_failure_spend_live_counters_chaos.py @@ -118,9 +118,11 @@ def test_broken_streams_through_a_redis_stall_log_once_and_the_budget_holds_on_e seconds=30, return_last_on_timeout=True, ) - # The cold counter is seeded from the database, and a spend flush during the stall can land these rows - # there first, so it may count them twice, as completed streams held past a flush do - assert spent - 1e-9 <= landed <= 2 * spent + 1e-9, f"one broken stream costs {cost}" + assert spent - 1e-9 <= landed <= 2 * spent + 1e-9, ( + f"one broken stream costs {cost}. The cold counter is seeded from the database, and a spend flush" + " during the stall can land these rows there first, so up to twice their cost is expected, as for" + " completed streams held past a flush" + ) budgeted: Final = scenario.key(models=[model], max_budget=cost / 2) broken_stream(candidate, model, budgeted)