pgsql: test_aio: Fix broken error recovery assertions in 001_aio

Started by Michael Paquier3 months ago1 messagescommitters
Jump to latest
#1Michael Paquier
michael@paquier.xyz

test_aio: Fix broken error recovery assertions in 001_aio

The three error recovery checks in `test_handle()` used "qr/^|ok$/" to
look for the marker "ok" in psql's output. '^' matches every string, so
the assertions passed no matter what psql printed.

Spelling the regex correctly as "qr/^ok\|$/" exposed that the explicit
xact case was actually failing, reporting an incorrect "current
transaction is aborted" instead of showing that an AIO handle can be
acquired again after an error. This is rewritten with a ROLLBACK,
similarly to the subxact counterpart.

While on it, the subxact case had no marker column in its query, so add
one there for consistency, and reformat to use same pattern.

Author: Jelte Fennema-Nio <me@jeltef.nl>
Discussion: /messages/by-id/DKSU6GI1YLG5.3VF6M4IRKQ7XE@jeltef.nl
Backpatch-through: 18

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/86ed13547589d8401b3b1e1ec2873903b287cb80

Modified Files
--------------
src/test/modules/test_aio/t/001_aio.pl | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)