Skip to content

Isolate Postgres integration replication state#978

Open
danddanddand wants to merge 2 commits into
xataio:mainfrom
danddanddand:split/issue-16-integration-isolation
Open

Isolate Postgres integration replication state#978
danddanddand wants to merge 2 commits into
xataio:mainfrom
danddanddand:split/issue-16-integration-isolation

Conversation

@danddanddand

@danddanddand danddanddand commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • use per-test Postgres replication slots for integration listeners and clean them up after stream shutdown
  • run shared integration setup in migrations-only mode so it no longer creates an unused default replication slot
  • surface async runStream/runSnapshot errors from test cleanup
  • narrow reused snapshot subtests from broad *.* table selection to the tables created by each subtest

Testing

  • git diff --check
  • make test
  • make integration-test

Fixes #975

Note: the snapshot subtest table-narrowing hunks in snapshot_pg_integration_test.go are intentionally duplicated in #976 (they are needed there for strict-mode snapshots to pass CI). The hunks are identical, so the two PRs merge cleanly in either order.

@kvch kvch left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you! If you are up for it, could you please remove the default slot created in setup_test.go? It is not used anymore.

@danddanddand

Copy link
Copy Markdown
Contributor Author

Done — setup_test.go now runs Init with MigrationsOnly: true, so the pgstream migrations still run but the unused default replication slot is no longer created.

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.

[Tests] Isolate Postgres integration replication state

2 participants