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.

fix(tests): declare the db access the legacy-schema gate makes (#88784)

Daniel RC856feaab235e
diff --git a/posthog/hogql_queries/ai/test/test_ai_table_resolver.py b/posthog/hogql_queries/ai/test/test_ai_table_resolver.py
index a7bb4da6a8b6..570cc257c12f 100644
--- a/posthog/hogql_queries/ai/test/test_ai_table_resolver.py
+++ b/posthog/hogql_queries/ai/test/test_ai_table_resolver.py
@@ -37,6 +37,10 @@ class TestIsAiEventsEnabled:
)
+# query_ai_events resolves the events-schema gate. On a legacy-schema run that gate falls through
+# to an instance setting read from Postgres, which only stays off the wire while some earlier
+# BaseTest has warmed its cache. Declare the access rather than depend on test order.
class TestQueryAiEvents:
def _make_query(self):
return ast.SelectQuery(