Skip to content

: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.

chore(stripe): de-flake account-request expiry test on slow shards (#73102)

Alessandro Pogliaghi6471ef2b2ead
diff --git a/ee/partners/stripe/api/provisioning/test/test_account_requests.py b/ee/partners/stripe/api/provisioning/test/test_account_requests.py
index 043083a459b0..8ae4e68dd5e2 100644
--- a/ee/partners/stripe/api/provisioning/test/test_account_requests.py
+++ b/ee/partners/stripe/api/provisioning/test/test_account_requests.py
@@ -1,9 +1,6 @@
-from datetime import timedelta
-
from unittest.mock import patch
from django.core.cache import cache
-from django.utils import timezone
from parameterized import parameterized
@@ -20,7 +17,10 @@ def _account_request(email: str, **overrides) -> dict:
"id": "acctreq_test",
"email": email,
"scopes": ["query:read"],
- "expires_at": (timezone.now() + timedelta(minutes=10)).isoformat(),
+ # Static, not now()+delta: @parameterized.expand builds the invalid-request cases at
+ # collection time, so a relative expiry can lapse before a slow shard reaches them and
+ # trip the "expired" check ahead of the field validation each case actually asserts.
+ "expires_at": "2999-01-01T00:00:00+00:00",
"orchestrator": {"type": "stripe", "stripe": {"account": "acct_test"}},
}
body.update(overrides)