Skip to content

pg_replication_status partial-failure test: replace pg_current_wal_lsn REVOKE with fixture-owned function #9

@jeffyaw

Description

@jeffyaw

src/integration/admin.integration.test.ts:518-583 exercises the _warnings populated path by REVOKE EXECUTE ON FUNCTION pg_catalog.pg_current_wal_lsn() FROM PUBLIC, then re-granting in cleanup. The structure is correct (captures testError, runs cleanup unconditionally), but a hard process crash between REVOKE and GRANT leaves the cluster broken for every non-superuser session until manually re-granted.

Options:

  1. Replace with a fixture-owned function whose grants can be flipped without touching pg_catalog. The handler would need a way to call this fixture function instead of pg_current_wal_lsn(), which probably isn't clean.
  2. Write a different _warnings-shape test path that doesn't depend on which function is being permission-gated -- e.g. swap to a role that lacks REPLICATION attribute and exercise the pg_replication_slots permission gate instead (already permission-gated on some managed providers).
  3. Gate the REVOKE test behind a POSTGRES_MCP_DESTRUCTIVE_TESTS=1 env flag so it only runs on disposable CI clusters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions