: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
chore(aio): pin retention on settle-poll test rows (#87573)
Adam Bowker6e9c44f1f709
diff --git a/posthog/temporal/ai_observability/test_run_aggregate_evaluation.py b/posthog/temporal/ai_observability/test_run_aggregate_evaluation.pyindex 66b0093ef0d1..d2721344e0a5 100644--- a/posthog/temporal/ai_observability/test_run_aggregate_evaluation.py+++ b/posthog/temporal/ai_observability/test_run_aggregate_evaluation.py@@ -59,15 +59,21 @@ def _insert_ai_event(`_timestamp` from the same `timestamp` value it inserts, so tests that need to simulateingestion lag write directly against the columns AI_EVENTS_TABLE_BASE_SQL leaves withouta default.++ `retention_days` is pinned the same way `bulk_create_ai_events` pins it. ai_events is+ `TTL drop_date` with `drop_date = toDate(timestamp) + retention_days`, and TTL runs on the+ server's real clock while these rows carry a frozen `timestamp` — on the column default of 30+ days, a fixture row silently expires once the frozen date falls more than 30 days behind today+ and the poll finds nothing."""sync_execute("""INSERT INTO sharded_ai_events (uuid, event, timestamp, team_id, distinct_id, person_id, properties,- trace_id, session_id, is_error, _timestamp, _offset, _partition+ trace_id, session_id, is_error, retention_days, _timestamp, _offset, _partition) VALUES (%(uuid)s, %(event)s, %(timestamp)s, %(team_id)s, %(distinct_id)s, %(person_id)s, %(properties)s,- %(trace_id)s, %(session_id)s, 0, %(_timestamp)s, 0, 0+ %(trace_id)s, %(session_id)s, 0, %(retention_days)s, %(_timestamp)s, 0, 0)""",{@@ -80,6 +86,7 @@ def _insert_ai_event("properties": "{}","trace_id": trace_id,"session_id": session_id,+ "retention_days": 10000,"_timestamp": arrival.strftime("%Y-%m-%d %H:%M:%S"),},flush=False,