Repository navigation
test(reporting): run the reporting-subscription stores against PostgreSQL - #1726
Conversation
…eSQL Covers PgReportingSubscriptionStateStore and PgPrincipalRecordStore on a real database: idempotent schema creation, compare-and-swap semantics, 20 concurrent writers losing nothing, and a restarted seller (a new PrincipalService and engine on the same database) serving the same get_principal readback and owing the same periods. The module skips without ADCP_PG_TEST_URL; CI's core Postgres lane runs it. Refs #1695 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Ladon verdict: Approve
Approve.
Test-only PR: one new 147-line Postgres conformance test for PgReportingSubscriptionStateStore and PgPrincipalRecordStore, shipped under a test: commit, releasing nothing. No no-auto-approve team match, gated_paths false, high_risk false, first review.
Reviewer verified imports resolve, CAS assertions match the store's INSERT-ON-CONFLICT/UPDATE-WHERE-revision semantics, the 20-writer concurrency test is a correct optimistic-retry loop, and asyncio_mode=auto covers undecorated async tests/fixtures. No blocking or medium findings.
One low follow-up (non-blocking, omitted from gate): the pool fixture reimplements isolated_reporting_pool but drops its finally-based teardown, leaking the random-named test schema on failure — worth tidying but not merge-blocking.
Decision table: rows 1–8 do not fire (no critical/high/medium findings, no gate, no team match). Falls through to row 9 → approve.
Part of #1695. This adds the PostgreSQL conformance test for the stores merged in #1724, as a
test:commit so it releases nothing.tests/conformance/reporting/test_reporting_subscriptions_pg.pycoversPgReportingSubscriptionStateStoreandPgPrincipalRecordStoreon a real database, each test in its own schema:PrincipalServiceandReportingSubscriptionEngineon the same database serve the sameget_principalreadback and owe identical periods and coverage.The module skips without
ADCP_PG_TEST_URL. CI's core Postgres lane already runstests/conformance/reporting/with it set, so no workflow change is needed. Locally against PostgreSQL 16: 4 passed.Refs #1695
🤖 Generated with Claude Code