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: Simplify tests of postgres_fdw terminating connections
Date: Wed, 14 Apr 2021 05:33:10 +0000
Message-ID: <E1lWY9G-0005P4-T6@gemulon.postgresql.org> (raw)

Simplify tests of postgres_fdw terminating connections

The tests introduced in 32a9c0b for connections broken and
re-established rely on pg_terminate_backend() for their logic.  When
these were introduced, this function simply sent a signal to a backend
without waiting for the operation to complete, and the tests repeatedly
looked at pg_stat_activity to check if the operation was completed or
not.  Since aaf0432, it is possible to define a timeout to make
pg_terminate_backend() wait for a certain duration, so make use of it,
with a timeout reasonably large enough (3min) to give enough room for
the tests to pass even on slow machines.

Some measurements show that the tests of postgres_fdw are much faster
with this change.  For example, on my laptop, they now take 4s instead
of 6s.

Author: Bharath Rupireddy
Discussion: https://postgr.es/m/CALj2ACXGY_EfGrMTjKjHy2zi-u1u9rdeioU_fro0T6Jo8t56KQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/93f41461449f917da20af4fa2973f8afe8e6ea6e

Modified Files
--------------
contrib/postgres_fdw/expected/postgres_fdw.out | 34 ++++++++++++--------------
contrib/postgres_fdw/sql/postgres_fdw.sql      | 26 +++++---------------
2 files changed, 22 insertions(+), 38 deletions(-)



Message-ID: <E1lWY9G-0005P4-T6@gemulon.postgresql.org>
Permalink:  ../E1lWY9G-0005P4-T6@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lWY9G-0005P4-T6@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: Simplify tests of postgres_fdw terminating connections
  In-Reply-To: <E1lWY9G-0005P4-T6@gemulon.postgresql.org>
  References: <E1lWY9G-0005P4-T6@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