pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Improve cleanup phases in regression tests of pg_stat_statements
Date: Mon, 06 Mar 2023 23:59:11 +0000
Message-ID: <E1pZKjX-002GIx-Cx@gemulon.postgresql.org> (raw)

Improve cleanup phases in regression tests of pg_stat_statements

As shaped, two DROP ROLE queries included in "user_activity" were
showing in the reports for "wal".  The intention is to keep each test
isolated and independent, so this is incorrect.  This commit adds some
calls to pg_stat_statements_reset() to clean up the statistics once each
test finishes, so as there are no risks of overlap in the reports for
individial scenarios.

The addition in "user_activity" fixes the output of "wal".  The new
resets done in "level_tracking" and "utility" are added for consistency
with the rest, though they do not affect the stats generated in the
other tests.

Oversight in d0028e3.

Reported-by: Andrei Zubkov
Discussion: https://postgr.es/m/7beb722dd016bf54f1c78bfd6d44a684e28da624.camel@moonset.ru

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9a714b9d6ec0a562bc9242ec17122321cd174588

Modified Files
--------------
.../pg_stat_statements/expected/level_tracking.out    |  6 ++++++
contrib/pg_stat_statements/expected/user_activity.out |  6 ++++++
contrib/pg_stat_statements/expected/utility.out       |  6 ++++++
contrib/pg_stat_statements/expected/wal.out           | 19 ++++++++-----------
contrib/pg_stat_statements/sql/level_tracking.sql     |  1 +
contrib/pg_stat_statements/sql/user_activity.sql      |  1 +
contrib/pg_stat_statements/sql/utility.sql            |  1 +
7 files changed, 29 insertions(+), 11 deletions(-)



Message-ID: <E1pZKjX-002GIx-Cx@gemulon.postgresql.org>
Permalink:  ../E1pZKjX-002GIx-Cx@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1pZKjX-002GIx-Cx@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: Improve cleanup phases in regression tests of pg_stat_statements
  In-Reply-To: <E1pZKjX-002GIx-Cx@gemulon.postgresql.org>
  References: <E1pZKjX-002GIx-Cx@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox