Re: Python/pytest test framework take two

From: "Jelte Fennema-Nio" <me(at)jeltef(dot)nl>
To: "Pavlo Sukhanov" <pavlo(at)toothywalrus(dot)dev>
Cc: <nik(at)postgres(dot)ai>, <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Python/pytest test framework take two
Date: 2026-11-26 13:07:18
Message-ID: DN55YYAHBHYF.3C7QMVGXSJPJ0@jeltef.nl
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, 22 Nov 2026 at 11:06, Pavlo Sukhanov <pavlo(at)toothywalrus(dot)dev> wrote:
> This is my first review on this list.

Thanks for the review! Attached is v4, which addresses almost all of it.

- Rebased, including section 11e of 049 and PG_TEST_SERVER_POSTGRES_OPTS.

- 1 (SIGTERM): SIGTERM now raises a KeyboardInterrupt subclass, so
teardown runs like on Ctrl-C. It can't be SystemExit, because pytest
treats that as a test failure and continues. pytest.exit() would be
the natural choice, but it derives from Exception instead of
BaseException (I opened a PR[1] to change that, but it'll be years
before we can rely on that). Teardown also needed to ignore
BrokenPipeError, because meson closes the output pipes right after
sending SIGTERM.

- 2 (auth): initdb now always uses trust. Like Cluster.pm, servers now
also only listen on their Unix socket (or use SSPI on Windows), since
otherwise any local user could connect over TCP.

- 3 (versions): Kept the floors. Hook wrappers are now old-style, and
timestamps are normalized on Python < 3.11. Tested with Python 3.9,
pytest
7.2.1 and pluggy 1.0.0.

- 4, 5, PG_CONFIG, README, pip install: all fixed.

- The result(timeout=...) issue I left as is: a test that catches the
timeout has decided it doesn't care about that query anymore.

[1]: https://github.com/pytest-dev/pytest/pull/15442

Attachment Content-Type Size
v4-0001-ci-show-more-than-100-lines-of-a-failing-test-s-l.patch text/x-patch 1.6 KB
v4-0002-meson-Deduplicate-test-timeout-into-a-variable.patch text/x-patch 2.5 KB
v4-0003-ci-temporarily-install-a-32-bit-Python-in-the-32-.patch text/x-patch 3.0 KB
v4-0004-Add-support-for-pytest-test-suites.patch text/x-patch 35.5 KB
v4-0005-Add-pytest-infrastructure-to-interact-with-Postgr.patch text/x-patch 179.4 KB
v4-0006-POC-amcheck-port-TAP-test-001_verify_heapam-to-py.patch text/x-patch 17.4 KB
v4-0007-POC-test_json_parser-port-TAP-test-002_inline-to-.patch text/x-patch 13.7 KB
v4-0008-POC-recovery-port-TAP-test-049_wait_for_lsn-to-py.patch text/x-patch 105.7 KB
v4-0009-POC-test_aio-port-TAP-test-001_aio-to-pytest.patch text/x-patch 106.4 KB
v4-0010-POC-recovery-port-TAP-test-029_stats_restart-to-p.patch text/x-patch 22.9 KB
v4-0011-POC-recovery-port-TAP-test-031_recovery_conflict-.patch text/x-patch 25.4 KB
v4-0012-POC-subscription-port-TAP-test-031_column_list-to.patch text/x-patch 83.5 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message 신성준 2026-11-26 13:16:53 Preserve tablespace of exclusion constraint indexes in ALTER TYPE
Previous Message vignesh C 2026-11-26 12:57:37 Re: Wrong table in "conflicting or redundant WHERE clauses / column lists" publicaiton error