pgsql: psql: Make cancel test more timing robust

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: psql: Make cancel test more timing robust
Date: 2021-08-25 10:16:36
Message-ID: E1mIpxU-0000nq-BC@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

psql: Make cancel test more timing robust

The previous coding relied on the PID file appearing and the query
starting "fast enough", which can fail on slow machines. Also, there
might have been an undocumented interference between alarm and
IPC::Run. This new coding doesn't rely on any of these concurrency
mechanisms. Instead, we wait unitl the PID file is complete before
proceeding, and then also wait until the sleep query is registered by
the server.

Discussion: https://www.postgresql.org/message-id/flat/E1mH14Q-0002gh-HS%40gemulon.postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/43d4dd87977d5ed66961605649d61973caf80f40

Modified Files
--------------
src/bin/psql/t/020_cancel.pl | 35 +++++++++++++++++++++++++++--------
1 file changed, 27 insertions(+), 8 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Daniel Gustafsson 2021-08-25 12:02:05 Re: pgsql: psql: Add test for query canceling
Previous Message Peter Eisentraut 2021-08-25 08:25:57 pgsql: Fix typo