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

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: 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-05-15 08:59:20
Message-ID: 0134C9EC-5F6B-4EAC-B2D5-BB4249BEBD4D@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

> On 30 Mar 2023, at 22:29, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Well, we could do "select rolname from pg_roles order by 1" and
> actually compare the results of the two selects. That might be
> advisable anyway, in order to produce a complaint with useful
> detail when there is something wrong.

I took a look at this and came up with the attached. This adds a new parameter
to pg_regress for specifying a test which will be executed before and after the
suite, where the first invocation creates the expectfile for the second. For
storing the expecfile the temp dir creation is somewhat refactored. I've added
a sample test in the patch (to regress, not ECPG), but I'm sure it can be
expanded to be a bit more interesting. The comment which is now incorrectly
formatted was left like that to make review easier, if this gets committed it
will be fixed then.

I opted for this to use the machinery that pg_regress already has rather than
add a new mechanism (and dependency) for running and verifying queries. This
also avoids hardcoding the test making it easier to have custom queries during
hacking etc.

Looking at this I also found a bug introduced in the TAP format patch, which
made failed single run tests report as 0ms due to the parameters being mixed up
in the report function call. This is in 0002, which I'll apply to HEAD
regardless of 0001 as they are unrelated.

--
Daniel Gustafsson

Attachment Content-Type Size
v1-0002-pg_regress-Fix-reported-runtime-for-failed-single.patch application/octet-stream 1.2 KB
v1-0001-pg_regress-Add-database-verification-test.patch application/octet-stream 11.2 KB

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2023-05-15 19:38:17 Re: issue with meson builds on msys2
Previous Message Michael Paquier 2023-05-15 07:02:36 pgsql: doc: Fix incorrect version list for Windows SDK

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2023-05-15 10:06:07 Re: Missing update of all_hasnulls in BRIN opclasses
Previous Message Ajin Cherian 2023-05-15 08:43:48 Re: running logical replication as the subscription owner