From bb70fe3dd5ef7060c2ce196a12da207624db9cef Mon Sep 17 00:00:00 2001 From: Utkarsh Bahuguna Date: Thu, 8 Oct 2026 14:43:35 +0530 Subject: [PATCH] give the analytics test queries room on slow runners --- tests/unit/memory/test_attack_analytics.py | 6 +++++- tests/unit/memory/test_attack_analytics_eval_identity.py | 6 +++++- tests/unit/memory/test_attack_analytics_metadata.py | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/tests/unit/memory/test_attack_analytics.py b/tests/unit/memory/test_attack_analytics.py index 6e053c4334..fb9a34991e 100644 --- a/tests/unit/memory/test_attack_analytics.py +++ b/tests/unit/memory/test_attack_analytics.py @@ -99,8 +99,12 @@ def make_result( ) +# Only a guard against hangs: loaded CI runners have taken over 30s for these queries. +_QUERY_BUDGET_SECONDS = 120 + + def control() -> QueryControl: - return QueryControl(deadline=time.monotonic() + 10) + return QueryControl(deadline=time.monotonic() + _QUERY_BUDGET_SECONDS) def predicate(*, name: str, values: list[str | None], **options: Any) -> dict[str, Any]: diff --git a/tests/unit/memory/test_attack_analytics_eval_identity.py b/tests/unit/memory/test_attack_analytics_eval_identity.py index 53a90943da..bdb96a8a0b 100644 --- a/tests/unit/memory/test_attack_analytics_eval_identity.py +++ b/tests/unit/memory/test_attack_analytics_eval_identity.py @@ -76,8 +76,12 @@ def _result(*, index: int, target: TargetIdentifier, outcome: AttackOutcome, ope ) +# Only a guard against hangs: loaded CI runners have taken over 30s for these queries. +_QUERY_BUDGET_SECONDS = 120 + + def _control() -> QueryControl: - return QueryControl(deadline=time.monotonic() + 20) + return QueryControl(deadline=time.monotonic() + _QUERY_BUDGET_SECONDS) def test_target_evaluation_v1_is_frozen_to_the_current_marker_rules() -> None: diff --git a/tests/unit/memory/test_attack_analytics_metadata.py b/tests/unit/memory/test_attack_analytics_metadata.py index 43fc01cc0f..31e9f5c9de 100644 --- a/tests/unit/memory/test_attack_analytics_metadata.py +++ b/tests/unit/memory/test_attack_analytics_metadata.py @@ -80,8 +80,12 @@ def _result( ) +# Only a guard against hangs: loaded CI runners have taken over 30s for these queries. +_QUERY_BUDGET_SECONDS = 120 + + def _control() -> QueryControl: - return QueryControl(deadline=time.monotonic() + 30) + return QueryControl(deadline=time.monotonic() + _QUERY_BUDGET_SECONDS) def _filters(*, values: list[tuple[AttackAnalyticsDimension, str]]) -> AttackAnalyticsFilters: