From: Sehrope Sarkuni <noreply@github.com>
To: pgsql-jdbc@lists.postgresql.org
Subject: [pgjdbc/pgjdbc] ad7345: Clean up some tests and fix IsValidTest race condi...
Date: Thu, 24 Oct 2019 07:45:50 -0700
Message-ID: <pgjdbc/pgjdbc/push/refs/heads/master/0fd453-ad7345@github.com> (raw)
Branch: refs/heads/master
Home: https://github.com/pgjdbc/pgjdbc
Commit: ad734574726eb0decf5178071c87a1b513e484f2
https://github.com/pgjdbc/pgjdbc/commit/ad734574726eb0decf5178071c87a1b513e484f2
Author: Sehrope Sarkuni <sehrope@jackdb.com>
Date: 2019-10-24 (Thu, 24 Oct 2019)
Changed paths:
M pgjdbc/src/test/java/org/postgresql/test/TestUtil.java
M pgjdbc/src/test/java/org/postgresql/test/jdbc2/CopyTest.java
M pgjdbc/src/test/java/org/postgresql/test/jdbc2/optional/ConnectionPoolTest.java
M pgjdbc/src/test/java/org/postgresql/test/jdbc4/IsValidTest.java
Log Message:
-----------
Clean up some tests and fix IsValidTest race condition (#1581)
* test: Add some helpers to TestUtil
Adds some helpers to TestUtil to deal with boiler plate of executinga query
and disgarding the results, fetching the backend process id, terminating a
backend process, and fetching the current transaction state.
* test: Clean up IsValidTest
Cleans up IsValidTest and removes a race condition when checking whether
terminated connections are marked as invalid. Also splits out the transaction
state test into three separate ones to better identify what's being tested.
* test: Change CopyTest to use TestUtil backend pid helpers
This also changes the connection termination to use a non-privileged
connection.
* test: Change ConnectionPoolTest to use backend pid TestUtil helpers
This also changes the pg_terminate_backend(...) call to use a non-privileged connection
as a regular user can terminate their own connection.
* fix: Use super user to terminate backend processes in tests
Older versions of the server (<=9.1) restrict calling pg_terminate_backend(...)
to super users so always use that in test helper.
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-jdbc@postgresql.org
Cc: noreply@github.com
Subject: Re: [pgjdbc/pgjdbc] ad7345: Clean up some tests and fix IsValidTest race condi...
In-Reply-To: <pgjdbc/pgjdbc/push/refs/heads/master/0fd453-ad7345@github.com>
References: <pgjdbc/pgjdbc/push/refs/heads/master/0fd453-ad7345@github.com>
* 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