Re: pgsql: Clean up role created in new subscription test.

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: Daniel Gustafsson <daniel(at)yesql(dot)se>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgsql: Clean up role created in new subscription test.
Date: 2023-11-08 11:42:26
Message-ID: 202311081142.znnn3kgehvqo@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On 2023-Nov-08, Peter Eisentraut wrote:

> I think the earlier idea of just counting roles, tablespaces, etc. before
> and after would be sufficient.

Maybe record global objects in a permanent table in test_setup.sql

create table global_objs as
select 'role', rolname from pg_roles
union all
select 'tablespace', spcname from pg_tablespace;

and at the end (maybe in test tablespace, though it's unrelated but it's
what runs last and drops regress_tablespace), have

(select 'role', rolname from pg_roles
union all
select 'tablespace', spcname from pg_tablespace)
except
select * from global_objs;

and check the expected as empty.

--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
"La verdad no siempre es bonita, pero el hambre de ella sí"

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Daniel Gustafsson 2023-11-08 12:15:00 Re: pgsql: Clean up role created in new subscription test.
Previous Message Heikki Linnakangas 2023-11-08 11:36:56 pgsql: Move a few ResourceOwnerEnlarge() calls for safety and clarity.

Browse pgsql-hackers by date

  From Date Subject
Next Message Tommy Pavlicek 2023-11-08 11:47:34 Re: Commitfest: older Waiting on Author entries
Previous Message Dilip Kumar 2023-11-08 11:40:43 Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock