| From: | "Jelte Fennema-Nio" <me(at)jeltef(dot)nl> |
|---|---|
| To: | "PostgreSQL Hackers" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "Daniel Gustafsson" <daniel(at)yesql(dot)se>, "Andres Freund" <andres(at)anarazel(dot)de> |
| Subject: | test_aio: Fix broken error recovery assertions in 001_aio |
| Date: | 2026-08-19 10:08:56 |
| Message-ID: | DKSU6GI1YLG5.3VF6M4IRKQ7XE@jeltef.nl |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
The three error recovery checks in `test_handle()` used `qr/^|ok$/` to
look for the `ok` marker column in psql's output. That is an alternation
of `^` and `ok$`, and `^` 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: its marker `SELECT` ran inside the
transaction that the preceding error had already aborted, so it failed
with "current transaction is aborted" instead of showing that an AIO
handle can be acquired again after an error. No statement can succeed in
an aborted transaction, so the recovery statement has to run after the
`ROLLBACK` that ends it, like the subxact case already does after its
`ROLLBACK TO SAVEPOINT`.
The subxact case had no marker column in its query at all, so add one
there, and use the same `SELECT 'ok', handle_get_release()` ordering in
all three checks.
This issue originally found on the pytest framework thread[1].
[1]: https://postgr.es/m/DKSSP47Y857Z.1FUU91WMDZWPZ%40jeltef.nl
| Attachment | Content-Type | Size |
|---|---|---|
| 0001-test_aio-Fix-broken-error-recovery-assertions-in-001.patch | text/x-patch | 2.7 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Jelte Fennema-Nio | 2026-08-19 10:10:47 | Re: Python/pytest test framework take two |
| Previous Message | shveta malik | 2026-08-19 09:52:46 | Re: [PATCH] Preserve replication origin OIDs in pg_upgrade |