:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(alerts): give each source binding a task queue and evaluation timeout (#111202)
Jimmy Zhud1eb4311b8de
diff --git a/docs/internal/alerts-platform-temporal.md b/docs/internal/alerts-platform-temporal.mdindex 19e7bcb008cc..0827b2abac6d 100644--- a/docs/internal/alerts-platform-temporal.md+++ b/docs/internal/alerts-platform-temporal.md@@ -131,7 +131,7 @@ The empty `--input '{}'` becomes an `OrchestrateInputs` with every field defaultWatch orchestration, its source dispatcher children, their evaluation children, and the delivery great-grandchildren in the Temporal UI at <http://localhost:8081>.Evaluation and delivery accept an empty `AlertsPlatformInputs` dataclass; orchestration accepts `OrchestrateInputs` with all fields defaulted.-Orchestration pages source dispatchers, which start evaluation children with a 75-second execution timeout and one workflow attempt.+Orchestration pages source dispatchers, which start evaluation children with one workflow attempt, on the queue and under the execution timeout of the source's binding.Evaluation child IDs carry the tick ID, source and page, so each tick starts distinct evaluations.Evaluation runs a Postgres connectivity probe; delivery runs an empty activity with no I/O.Evaluation and delivery activities each have a 10-second start-to-close timeout and a 30-second schedule-to-close timeout.@@ -166,7 +166,10 @@ The hard stop is the run's own execution timeout when it has one, and the budgetThe orchestrator passes a dispatcher every remaining ID for its source. The dispatcher decides how much to take and returns the rest.Today it takes everything: no adapter has said yet how many alerts one evaluation can hold, so nothing remains and a tick is one page.The limit that will matter is the evaluation workflow's own history, which depends on the adapter's query shape; it arrives with the first real adapter.-It starts one `alerts-platform-evaluate` child, ID `{dispatcher_id}-eval`, with `ParentClosePolicy.ABANDON`, a 75-second execution timeout (`SOURCE_EVALUATION_TIMEOUT`) and one attempt.+It starts one evaluation child per key with `ParentClosePolicy.ABANDON` and one attempt.+A source with an entry in `SOURCE_BINDINGS` (`temporal/sources.py`) starts the binding's workflow on the binding's `task_queue`, under its `evaluation_timeout`.+A source with no binding starts `alerts-platform-evaluate` on the evaluation queue, under the 75-second `NOOP_EVALUATION_TIMEOUT`.+A source with slow checks gets its own queue and its own timeout, so it neither shares the logs ceiling nor holds the logs worker's slots.The timeout has to hold every attempt a source's activities allow, because an attempt cut off here is a batch that decided something and recorded nothing.Evaluations are abandoned rather than awaited, so it does not have to fit inside the tick.It waits for the child to start, never for it to finish, then returns the dispatched count and the remaining IDs.@@ -195,7 +198,8 @@ Scheduled runs use `TemporalScheduledStartTime`; manual runs use the workflow stActivity retries retain the same cutoff rather than reading the activity's clock.The activity returns an `AlertDemand` containing configuration IDs grouped by the shared `SourceKind` enum (`logs` and `insight`).Only nonempty groups are returned. Discovery does not reserve or claim IDs.-Each source is bounded to `DISCOVERY_LIMIT_PER_SOURCE` IDs (1,000) so the manifest stays near 40 KB per source, under the repository's 256 KB rule for Temporal payload fields.+Each source is bounded to its binding's `discovery_limit`, or to `DISCOVERY_LIMIT_PER_SOURCE` (1,000) without a binding, so the manifest stays near 40 KB per source, under the repository's 256 KB rule for Temporal payload fields.+A source that admits fewer checks per tick sets a lower limit, because every key starts a workflow.`omitted_by_source` counts the due IDs left out. The tick adds that count to its `remaining` result, and the next tick discovers that work again.For now, `logic/demand.py` supplies deterministic synthetic configurations relative to that cutoff:@@ -405,7 +409,7 @@ all come from the existing logs code, so a preview says what production would ha### The query budget sits under the activity timeout-Four bounds, largest first: `SOURCE_EVALUATION_TIMEOUT` (75s) over the source's `EVALUATION_BUDGET` (62s) over `EVALUATE_START_TO_CLOSE` (30s) over `BATCH_QUERY_BUDGET_SECONDS` (25s) over `MAX_QUERY_SECONDS` (20s).+Four bounds, largest first: the logs binding's `evaluation_timeout` (75s) over the source's `EVALUATION_BUDGET` (62s) over `EVALUATE_START_TO_CLOSE` (30s) over `BATCH_QUERY_BUDGET_SECONDS` (25s) over `MAX_QUERY_SECONDS` (20s).Temporal bounds an attempt by whichever of start-to-close and schedule-to-close expires first, so schedule-to-close is derived as start-to-close plus a queue tolerance rather than written as a literal.A literal close to start-to-close lets queue time shorten the run below the query budget, which is the same inversion arriving by another route, on exactly the load that causes queueing.`test_the_evaluation_timeout_ladder_holds` asserts the whole ladder in one place.diff --git a/products/alerts_platform/backend/facade/temporal.py b/products/alerts_platform/backend/facade/temporal.pyindex 74ef52993c9d..72098cf62345 100644--- a/products/alerts_platform/backend/facade/temporal.py+++ b/products/alerts_platform/backend/facade/temporal.py@@ -3,6 +3,7 @@ from products.alerts_platform.backend.temporal.metrics import (ALERTS_PLATFORM_LATENCY_HISTOGRAM_METRICS,)from products.alerts_platform.backend.temporal.schedule import create_alerts_platform_tick_schedule+from products.alerts_platform.backend.temporal.sources import source_evaluation_timeoutfrom products.alerts_platform.backend.temporal.telemetry import AlertsPlatformTelemetryInterceptorfrom products.alerts_platform.backend.temporal.workflows import (DELIVERY_ACTIVITIES,@@ -12,7 +13,6 @@ from products.alerts_platform.backend.temporal.workflows import (EVALUATION_WORKFLOWS,SHARED_ORCHESTRATION_ACTIVITIES,SHARED_ORCHESTRATION_WORKFLOWS,- SOURCE_EVALUATION_TIMEOUT,)__all__ = [@@ -25,7 +25,7 @@ __all__ = ["EVALUATION_WORKFLOWS","SHARED_ORCHESTRATION_ACTIVITIES","SHARED_ORCHESTRATION_WORKFLOWS",- "SOURCE_EVALUATION_TIMEOUT","AlertsPlatformTelemetryInterceptor","create_alerts_platform_tick_schedule",+ "source_evaluation_timeout",]diff --git a/products/alerts_platform/backend/logic/demand.py b/products/alerts_platform/backend/logic/demand.pyindex 0c7c51b29b5c..29bbe03ccb5a 100644--- a/products/alerts_platform/backend/logic/demand.py+++ b/products/alerts_platform/backend/logic/demand.py@@ -1,4 +1,5 @@import datetime as dt+from collections.abc import Mappingfrom products.alerts_platform.backend.facade.contracts import AlertBatchKey, AlertDemand, SourceKindfrom products.alerts_platform.backend.logic.platform_lifecycle import due_q, slot_of, suppressed@@ -9,11 +10,13 @@ from products.alerts_platform.backend.models import PlatformAlertConfigurationDISCOVERY_LIMIT_PER_SOURCE = 1000-def discover_demand(cutoff: str, limit_per_source: int = DISCOVERY_LIMIT_PER_SOURCE) -> AlertDemand:+def discover_demand(cutoff: str, limits_by_source: Mapping[SourceKind, int] | None = None) -> AlertDemand:+ """A source `limits_by_source` does not name gets `DISCOVERY_LIMIT_PER_SOURCE` keys."""cutoff_time = dt.datetime.fromisoformat(cutoff)if cutoff_time.utcoffset() is None:raise ValueError("Demand discovery cutoff must include a timezone")- if limit_per_source < 1:+ limits = limits_by_source or {}+ if any(limit < 1 for limit in limits.values()):raise ValueError("Demand discovery limit must be at least 1")# Discovery is cross-team by definition, so it opts out of team scoping rather than running@@ -41,7 +44,7 @@ def discover_demand(cutoff: str, limit_per_source: int = DISCOVERY_LIMIT_PER_SOUcontinuesource_seen.add(key)keys = keys_by_source.setdefault(source, [])- if len(keys) < limit_per_source:+ if len(keys) < limits.get(source, DISCOVERY_LIMIT_PER_SOURCE):keys.append(key)else:omitted_by_source[source] = omitted_by_source.get(source, 0) + 1diff --git a/products/alerts_platform/backend/temporal/sources.py b/products/alerts_platform/backend/temporal/sources.pyindex 4d4f20aa2e63..b7dd4c7afbad 100644--- a/products/alerts_platform/backend/temporal/sources.py+++ b/products/alerts_platform/backend/temporal/sources.py@@ -1,4 +1,4 @@-"""Which sources evaluate for real, and under what workflow name.+"""Which sources evaluate for real, and how the dispatcher starts each one.A source's evaluation lives in that source's product, so the dispatcher starts it by namerather than by class. The alerts product imports nothing from a source.@@ -6,8 +6,52 @@ rather than by class. The alerts product imports nothing from a source.A source absent from this map keeps the noop evaluation path."""+import datetime as dt++from django.conf import settings++from posthog.dataclasses import frozen+from products.alerts_platform.backend.facade.contracts import SourceKind+from products.alerts_platform.backend.logic.demand import DISCOVERY_LIMIT_PER_SOURCE+++@frozen+class SourceBinding:+ workflow: str+ # The evaluation workflow runs here, and so does every activity it starts without naming a+ # queue. A source with slow checks gets its own queue, so it cannot hold the worker slots that+ # another source's checks need.+ task_queue: str+ # What an evaluation gets end to end: its reads, its write, and the delivery children it+ # starts. It has to hold every attempt a source's activities allow, because an attempt cut+ # off here is a batch that decided something and recorded nothing. Evaluations are abandoned+ # rather than awaited, so this does not have to fit inside the tick. It does hold the key for+ # its duration, which is what blocks a slow evaluation's own re-dispatch.+ evaluation_timeout: dt.timedelta+ # Batch keys one tick hands this source. Each key starts a workflow, so a source that admits+ # fewer checks than discovery finds would otherwise start workflows that return having done+ # nothing.+ discovery_limit: int++ def __post_init__(self) -> None:+ if self.discovery_limit < 1:+ raise ValueError("A source's discovery limit must be at least 1")-SOURCE_EVALUATION_WORKFLOWS: dict[SourceKind, str] = {- SourceKind.LOGS: "logs-alert-evaluate",++SOURCE_BINDINGS: dict[SourceKind, SourceBinding] = {+ SourceKind.LOGS: SourceBinding(+ workflow="logs-alert-evaluate",+ task_queue=settings.ALERTS_PLATFORM_EVALUATION_TASK_QUEUE,+ evaluation_timeout=dt.timedelta(seconds=75),+ discovery_limit=DISCOVERY_LIMIT_PER_SOURCE,+ ),}+++def source_evaluation_timeout(source: SourceKind) -> dt.timedelta:+ return SOURCE_BINDINGS[source].evaluation_timeout+++def discovery_limits() -> dict[SourceKind, int]:+ return {source: binding.discovery_limit for source, binding in SOURCE_BINDINGS.items()}diff --git a/products/alerts_platform/backend/temporal/workflows.py b/products/alerts_platform/backend/temporal/workflows.pyindex 0010dda0b5e7..538927f9ec0e 100644--- a/products/alerts_platform/backend/temporal/workflows.py+++ b/products/alerts_platform/backend/temporal/workflows.py@@ -21,7 +21,6 @@ from posthog.temporal.common.logger import get_write_only_loggerfrom products.alerts_platform.backend.temporal.metrics import increment_deliveries_previewed, safe_recordfrom products.alerts_platform.backend.temporal.outcomes import alerts_platform_record_outcomes_activity-from products.alerts_platform.backend.temporal.sources import SOURCE_EVALUATION_WORKFLOWSLOGGER = get_write_only_logger(__name__)@@ -48,6 +47,7 @@ with workflow.unsafe.imports_passed_through():)from products.alerts_platform.backend.logic.demand import discover_demandfrom products.alerts_platform.backend.temporal.postgres import check_postgres_connection+ from products.alerts_platform.backend.temporal.sources import SOURCE_BINDINGS, discovery_limitsPOSTGRES_PROBE_FAILURE = "AlertsPlatformPostgresProbeFailure"@@ -66,12 +66,8 @@ TICK_HARD_STOP_MARGIN = dt.timedelta(seconds=5)SOURCE_DISPATCH_TIMEOUT = dt.timedelta(seconds=30)# Time kept between a dispatcher's timeout and the hard stop, so the child closes first.SOURCE_DISPATCH_HEADROOM = dt.timedelta(seconds=1)-# What an evaluation gets end to end: its reads, its write, and the delivery children it starts.-# It has to hold every attempt a source's activities allow, because an attempt cut off here is a-# batch that decided something and recorded nothing. Evaluations are abandoned rather than-# awaited, so this does not have to fit inside the tick. It does hold the key for its duration,-# which is what blocks a slow evaluation's own re-dispatch.-SOURCE_EVALUATION_TIMEOUT = dt.timedelta(seconds=75)+# The noop evaluation's ceiling. A source with an adapter takes its own from its binding.+NOOP_EVALUATION_TIMEOUT = dt.timedelta(seconds=75)THREAD_BUSY = "AlertsPlatformThreadBusy"DELIVERY_START_TO_CLOSE = dt.timedelta(seconds=10)@@ -94,7 +90,7 @@ class AlertsPlatformInputs:@activity.defnasync def alerts_platform_discover_demand_activity(inputs: DemandDiscoveryInputs) -> AlertDemand:- return await database_sync_to_async_pool(discover_demand)(inputs.cutoff)+ return await database_sync_to_async_pool(discover_demand)(inputs.cutoff, limits_by_source=discovery_limits())@activity.defn@@ -247,14 +243,14 @@ class AlertsPlatformSourceDispatchWorkflow(PostHogWorkflow):async def run(self, inputs: SourceDispatchInputs) -> SourceDispatchReport:taken = inputs.batch_keys[:MAX_EVALUATIONS_PER_DISPATCH]remaining = inputs.batch_keys[MAX_EVALUATIONS_PER_DISPATCH:]- source_workflow = SOURCE_EVALUATION_WORKFLOWS.get(inputs.source)+ binding = SOURCE_BINDINGS.get(inputs.source)started_ids: list[str] = []already_running = 0for key in taken:evaluation_workflow_id = f"alerts-eval-{inputs.source.value}-{key.team_id}-{key.slot}"try:- if source_workflow is None:+ if binding is None:# No adapter yet. The key is not passed to the noop, and the probe path stays as is.await workflow.start_child_workflow(AlertsPlatformEvaluateWorkflow.run,@@ -262,17 +258,17 @@ class AlertsPlatformSourceDispatchWorkflow(PostHogWorkflow):id=evaluation_workflow_id,task_queue=settings.ALERTS_PLATFORM_EVALUATION_TASK_QUEUE,parent_close_policy=workflow.ParentClosePolicy.ABANDON,- execution_timeout=SOURCE_EVALUATION_TIMEOUT,+ execution_timeout=NOOP_EVALUATION_TIMEOUT,retry_policy=RetryPolicy(maximum_attempts=1),)else:await workflow.start_child_workflow(- source_workflow,+ binding.workflow,SourceEvaluationInputs(source=inputs.source, cutoff=inputs.cutoff, batch_key=key),id=evaluation_workflow_id,- task_queue=settings.ALERTS_PLATFORM_EVALUATION_TASK_QUEUE,+ task_queue=binding.task_queue,parent_close_policy=workflow.ParentClosePolicy.ABANDON,- execution_timeout=SOURCE_EVALUATION_TIMEOUT,+ execution_timeout=binding.evaluation_timeout,retry_policy=RetryPolicy(maximum_attempts=1),)except WorkflowAlreadyStartedError:diff --git a/products/alerts_platform/backend/tests/test_temporal_dispatch.py b/products/alerts_platform/backend/tests/test_temporal_dispatch.pyindex 1a26e3498c4d..13da43a98a31 100644--- a/products/alerts_platform/backend/tests/test_temporal_dispatch.py+++ b/products/alerts_platform/backend/tests/test_temporal_dispatch.py@@ -1,6 +1,7 @@"""PR 2 rules, each asserted against a real Temporal test server:- the real dispatcher takes everything, starts one abandoned evaluation, and reports nothing remaining+- a bound source's evaluation starts on its binding's queue, under its binding's timeout- discovery runs once per tick chain, never in a continued run- the tick awaits dispatcher reports and never an evaluation child- the tick exits cleanly with remaining work once its dispatch budget is spent@@ -46,7 +47,7 @@ from products.alerts_platform.backend.facade.temporal import (SHARED_ORCHESTRATION_WORKFLOWS,)from products.alerts_platform.backend.temporal import postgres, workflows-from products.alerts_platform.backend.temporal.sources import SOURCE_EVALUATION_WORKFLOWS+from products.alerts_platform.backend.temporal.sources import SOURCE_BINDINGS, SourceBindingfrom products.alerts_platform.backend.temporal.workflows import (AlertsPlatformEvaluateWorkflow,AlertsPlatformInputs,@@ -149,7 +150,7 @@ async def local_environment() -> AsyncIterator[WorkflowEnvironment]:def no_source_bindings() -> Iterator[None]:"""These tests cover paging and the dispatch budget, not which source evaluates for real.Clearing the registry keeps every source on the noop path; the binding has its own test."""- with patch.dict(SOURCE_EVALUATION_WORKFLOWS, clear=True):+ with patch.dict(SOURCE_BINDINGS, clear=True):yield@@ -261,7 +262,7 @@ async def test_real_dispatcher_takes_everything_and_abandons_one_evaluation(envichild = initiated[0].start_child_workflow_execution_initiated_event_attributesassert child.workflow_type.name == "alerts-platform-evaluate"assert child.parent_close_policy == ParentClosePolicy.PARENT_CLOSE_POLICY_ABANDON- assert child.workflow_execution_timeout.ToTimedelta() == workflows.SOURCE_EVALUATION_TIMEOUT+ assert child.workflow_execution_timeout.ToTimedelta() == workflows.NOOP_EVALUATION_TIMEOUT# One task per child start, plus the one that completed the run. A dispatcher that awaited an# evaluation would need a further task to resume on its result. Counting tasks rather than# forbidding a child-completion event keeps this off the race with an abandoned evaluation.@@ -271,6 +272,44 @@ async def test_real_dispatcher_takes_everything_and_abandons_one_evaluation(enviassert (await evaluation.describe()).status == WorkflowExecutionStatus.COMPLETED+async def test_a_bound_source_evaluates_on_its_own_queue_under_its_own_timeout(+ environment: WorkflowEnvironment,+) -> None:+ client = environment.client+ dispatcher_id = f"dispatch-{uuid.uuid4()}"+ binding = SourceBinding(+ workflow="test-bound-evaluation",+ task_queue="test-bound-evaluation-queue",+ evaluation_timeout=dt.timedelta(minutes=12),+ discovery_limit=1,+ )+ orchestration_worker, evaluation_worker = workers(client)+ with patch.dict(SOURCE_BINDINGS, {SourceKind.INSIGHT: binding}):+ async with orchestration_worker, evaluation_worker:+ await client.execute_workflow(+ AlertsPlatformSourceDispatchWorkflow.run,+ SourceDispatchInputs(+ tick_id="tick",+ source=SourceKind.INSIGHT,+ page=0,+ batch_keys=[key("bound")],+ cutoff="2026-09-16T10:00:00+00:00",+ ),+ id=dispatcher_id,+ task_queue=ORCHESTRATION_QUEUE,+ execution_timeout=dt.timedelta(seconds=30),+ )++ history = await client.get_workflow_handle(dispatcher_id).fetch_history()+ (initiated,) = events_of(history, EventType.EVENT_TYPE_START_CHILD_WORKFLOW_EXECUTION_INITIATED)+ child = initiated.start_child_workflow_execution_initiated_event_attributes+ assert (child.workflow_type.name, child.task_queue.name, child.workflow_execution_timeout.ToTimedelta()) == (+ binding.workflow,+ binding.task_queue,+ binding.evaluation_timeout,+ )++async def test_a_key_whose_evaluation_still_runs_is_skipped_without_losing_the_page(environment: WorkflowEnvironment,) -> None:diff --git a/products/alerts_platform/backend/tests/test_temporal_workflows.py b/products/alerts_platform/backend/tests/test_temporal_workflows.pyindex b6083fd0ac66..163cfef74dd0 100644--- a/products/alerts_platform/backend/tests/test_temporal_workflows.py+++ b/products/alerts_platform/backend/tests/test_temporal_workflows.py@@ -553,7 +553,7 @@ class TestDemandDiscovery(APIBaseTest):self._configuration(minutes_ago=1, name="newer")self._configuration(minutes_ago=5, name="oldest")- bounded = demand.discover_demand(self.tick.isoformat(), limit_per_source=1)+ bounded = demand.discover_demand(self.tick.isoformat(), limits_by_source={SourceKind.LOGS: 1})# Oldest first, so a key the bound leaves out grows more overdue and wins a later tick.assert bounded.batch_keys_by_source == {SourceKind.LOGS: [self._key(5)]}@@ -580,7 +580,7 @@ class TestDemandDiscovery(APIBaseTest):def test_discovery_rejects_a_limit_below_one(self) -> None:with pytest.raises(ValueError):- demand.discover_demand(self.tick.isoformat(), limit_per_source=0)+ demand.discover_demand(self.tick.isoformat(), limits_by_source={SourceKind.LOGS: 0})@pytest.mark.parametrize("scheduled", [False, True])@@ -630,21 +630,25 @@ def test_the_dispatcher_is_registered_on_the_fleet_the_tick_starts_it_on() -> Noassert AlertsPlatformSourceDispatchWorkflow in registered-def test_every_source_evaluation_binding_names_a_registered_workflow() -> None:+def test_every_source_evaluation_binding_names_a_workflow_registered_on_its_queue() -> None:import temporalio.workflow # noqa: PLC0415 — read after the registry# The registry imports every product's workflows, so it stays off this module's import path.from posthog.management.commands.start_temporal_worker import WORKFLOWS_DICT # noqa: PLC0415from products.alerts_platform.backend.temporal.sources import ( # noqa: PLC0415 — read after the registry- SOURCE_EVALUATION_WORKFLOWS,+ SOURCE_BINDINGS,)- definitions = (- temporalio.workflow._Definition.from_class(registered_workflow)- for registered_workflow in WORKFLOWS_DICT[settings.ALERTS_PLATFORM_EVALUATION_TASK_QUEUE]- )- registered = {definition.name for definition in definitions if definition is not None}- # A binding naming a workflow no evaluation worker registers leaves every dispatch for+ def registered_on(task_queue: str) -> set[str | None]:+ definitions = (temporalio.workflow._Definition.from_class(w) for w in WORKFLOWS_DICT[task_queue])+ return {definition.name for definition in definitions if definition is not None}++ # A binding naming a workflow its queue's worker does not register leaves every dispatch for# that source queued until it times out.- assert set(SOURCE_EVALUATION_WORKFLOWS.values()) <= registered+ unregistered = {+ source: binding.workflow+ for source, binding in SOURCE_BINDINGS.items()+ if binding.workflow not in registered_on(binding.task_queue)+ }+ assert unregistered == {}diff --git a/products/logs/backend/temporal/alert_evaluate.py b/products/logs/backend/temporal/alert_evaluate.pyindex 9f069e698cff..ba96b84356f1 100644--- a/products/logs/backend/temporal/alert_evaluate.py+++ b/products/logs/backend/temporal/alert_evaluate.py@@ -43,7 +43,7 @@ EVALUATE_SCHEDULE_TO_CLOSE = EVALUATE_START_TO_CLOSE + EVALUATE_QUEUE_TOLERANCE# the next tick reaches it anyway, and holding the key meanwhile blocks its own re-dispatch.RECORD_START_TO_CLOSE = dt.timedelta(seconds=8)RECORD_SCHEDULE_TO_CLOSE = dt.timedelta(seconds=12)-# What the source needs from the platform's `SOURCE_EVALUATION_TIMEOUT`, which has to hold both+# What the source needs from its binding's `evaluation_timeout`, which has to hold both# activities and still leave room to start the delivery children.EVALUATION_BUDGET = EVALUATE_SCHEDULE_TO_CLOSE + RECORD_SCHEDULE_TO_CLOSEdiff --git a/products/logs/backend/test/test_alert_evaluate.py b/products/logs/backend/test/test_alert_evaluate.pyindex c411071e8e20..7686dbf403d8 100644--- a/products/logs/backend/test/test_alert_evaluate.py+++ b/products/logs/backend/test/test_alert_evaluate.py@@ -23,7 +23,7 @@ from products.alerts_platform.backend.facade.contracts import (SourceKind,)from products.alerts_platform.backend.facade.lifecycle import AlertState-from products.alerts_platform.backend.facade.temporal import SOURCE_EVALUATION_TIMEOUT+from products.alerts_platform.backend.facade.temporal import source_evaluation_timeoutfrom products.cdp.backend.models.hog_functions.hog_function import HogFunctionfrom products.logs.backend.alert_check_query import BatchedBucketedResult, BucketedCountfrom products.logs.backend.alert_source_cycle import BATCH_QUERY_BUDGET_SECONDS, MAX_QUERY_SECONDS, evaluate_logs_batch@@ -383,4 +383,4 @@ class TestEvaluationTimeoutLadder(SimpleTestCase):assert EVALUATE_SCHEDULE_TO_CLOSE > EVALUATE_START_TO_CLOSEassert (EVALUATE_SCHEDULE_TO_CLOSE - EVALUATE_START_TO_CLOSE).total_seconds() >= BATCH_QUERY_BUDGET_SECONDS / 2# The platform's own timeout holds both activities and still leaves room for the deliveries.- assert SOURCE_EVALUATION_TIMEOUT > EVALUATION_BUDGET+ assert source_evaluation_timeout(SourceKind.LOGS) > EVALUATION_BUDGET