From 4d1e464bbb0f106c1628e0f61b09f60c8bd7216f Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 15 Nov 2026 03:43:16 +0000 Subject: [PATCH] test(integration): wait for the sentinel key soft budget alert instead of taking its first alert --- .../observability/test_user_soft_budget_alert.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/integration/observability/test_user_soft_budget_alert.py b/tests/integration/observability/test_user_soft_budget_alert.py index b25495f694f..a59b3ab00ff 100644 --- a/tests/integration/observability/test_user_soft_budget_alert.py +++ b/tests/integration/observability/test_user_soft_budget_alert.py @@ -235,8 +235,11 @@ def alerts_once_a_later_key_alert_lands( """Alerts naming a watched id, read after a key soft budget alert sent later has reached the sink.""" alias: Final = f"sentinel-{uuid.uuid4().hex}" gateway.chat(model, key=scenario.key(key_alias=alias, soft_budget=SOFT_BUDGET, spend=SPEND)) - (sentinel, *_) = alerts_naming(alerts, alias) - assert "Soft Budget Crossed" in slack_text(sentinel), sentinel + eventually( + lambda: alerts.naming(alias), + lambda found: any("Soft Budget Crossed" in slack_text(body) for body in found), + seconds=ALERT_SECONDS, + ) return tuple(body for body in alerts.bodies() if any(marker in body for marker in watched))