Skip to content

test(reporting): run the reporting-subscription stores against PostgreSQL - #1726

Merged
bokelley merged 1 commit into
nextfrom
claude/issue-1695-subscription-pg-tests
Oct 30, 2026
Merged

bokelley merged 1 commit into
nextfrom
claude/issue-1695-subscription-pg-tests

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

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.py covers PgReportingSubscriptionStateStore and PgPrincipalRecordStore on a real database, each test in its own schema:

  • idempotent schema creation;
  • compare-and-swap semantics: insert-if-absent, a stale revision refused, revision increments;
  • 20 concurrent writers losing nothing;
  • a restarted seller: a new PrincipalService and ReportingSubscriptionEngine on the same database serve the same get_principal readback and owe identical periods and coverage.

The module skips without ADCP_PG_TEST_URL. CI's core Postgres lane already runs tests/conformance/reporting/ with it set, so no workflow change is needed. Locally against PostgreSQL 16: 4 passed.

Refs #1695

🤖 Generated with Claude Code

…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>

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@bokelley
bokelley merged commit eab57f9 into next Oct 30, 2026
77 of 78 checks passed
@bokelley
bokelley deleted the claude/issue-1695-subscription-pg-tests branch October 30, 2026 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant