From 47380ae72d92a2d6e73fd8a0346f813aba53818b Mon Sep 17 00:00:00 2001 From: yucheng Date: Thu, 1 Oct 2026 00:08:56 +0000 Subject: [PATCH] test(guardrails): poll worker-kill spend rows to settle before the duplicate check Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../observability/test_azure_content_safety_audit.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/integration/observability/test_azure_content_safety_audit.py b/tests/integration/observability/test_azure_content_safety_audit.py index 1cd13e5f6a2..711268d3dbd 100644 --- a/tests/integration/observability/test_azure_content_safety_audit.py +++ b/tests/integration/observability/test_azure_content_safety_audit.py @@ -963,9 +963,11 @@ def test_killing_a_worker_mid_burst_leaves_no_duplicate_rows( assert {identity for identity, status in outcomes if status == 200} <= set(scans), (outcomes, scans) rows: Final = eventually( lambda: read_rows('SELECT request_id, metadata FROM "LiteLLM_SpendLogs" WHERE model_group=%s', (model,)), - lambda values: len(values) >= 1, - seconds=70, + lambda values: len(values) >= len(survivors), + seconds=30, + return_last_on_timeout=True, ) + assert rows, outcomes assert len(rows) <= len(survivors), (outcomes, rows) assert len({row["request_id"] for row in rows}) == len(rows), rows for row in rows: