pgsql: test_aio: Add read_stream test infrastructure & tests

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: test_aio: Add read_stream test infrastructure & tests
Date: 2026-03-27 22:54:01
Message-ID: E1w6G40-001l2x-2F@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

test_aio: Add read_stream test infrastructure & tests

While we have a lot of indirect coverage of read streams, there are corner
cases that are hard to test when only indirectly controlling and observing the
read stream. This commit adds an SQL callable SRF interface for a read stream
and uses that in a few tests.

To make some of the tests possible, the injection point infrastructure in
test_aio had to be expanded to allow blocking IO completion.

While at it, fix a wrong debug message in inj_io_short_read_hook().

Author: Andres Freund <andres(at)anarazel(dot)de>
Reviewed-by: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>
Reviewed-by: Melanie Plageman <melanieplageman(at)gmail(dot)com>
Discussion: https://postgr.es/m/zljergweqti7x67lg5ije2rzjusie37nslsnkjkkby4laqqbfw@3p3zu522yykv

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1f6f200cab67e67f1c20d9c9ca5013e0f23f51e4

Modified Files
--------------
src/test/modules/test_aio/meson.build | 1 +
src/test/modules/test_aio/t/004_read_stream.pl | 278 ++++++++++++++++++++
src/test/modules/test_aio/test_aio--1.0.sql | 19 +-
src/test/modules/test_aio/test_aio.c | 340 +++++++++++++++++++++----
src/tools/pgindent/typedefs.list | 1 +
5 files changed, 587 insertions(+), 52 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2026-03-27 23:02:29 pgsql: Fix RequestNamedLWLockTranche in single-user mode
Previous Message Tom Lane 2026-03-27 21:41:19 pgsql: Doc: split functions-posix-regexp section into multiple subsecti