: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
fix(test): freeze time in subscription schedule test to prevent flaky failures (#68245)
mendral-app[bot]a824d3c21d95
diff --git a/ee/api/test/test_subscription.py b/ee/api/test/test_subscription.pyindex 6f0cd9a09d96..cd5b99cfe658 100644--- a/ee/api/test/test_subscription.py+++ b/ee/api/test/test_subscription.py@@ -4,6 +4,7 @@ from typing import Optionalfrom uuid import uuid4import pytest+from freezegun import freeze_timefrom unittest.mock import AsyncMock, MagicMock, patchfrom django.core.cache import cache@@ -349,6 +350,7 @@ class TestSubscriptionTemporal(APILicensedTest):assert properties["delivery_triggered"] is should_fireassert properties["reason"] == expected_reason+ @freeze_time("2026-06-15T10:00:00Z") # Monday — weekly (Sat) is 5 days away, daily is 1 daydef test_schedule_only_update_still_recomputes_next_delivery_date(self):# A schedule edit must not fire a delivery but MUST still reschedule — the model# save() recomputes next_delivery_date; this guards that the no-fire short-circuit