]> git.ipfire.org Git - thirdparty/postgresql.git/commit
backport: Extend background_psql() to be able to start asynchronously
authorAndres Freund <andres@anarazel.de>
Wed, 19 Feb 2025 14:41:08 +0000 (09:41 -0500)
committerAndres Freund <andres@anarazel.de>
Wed, 19 Feb 2025 14:45:05 +0000 (09:45 -0500)
commit6ab58d506bba28fa46a6c993a7e82d6053651546
treeb5f139f80f5c8ab4c1fb38ab961613f0c880f584
parentfbfd38662f7273660fe45f59e7a5e4e3ec9f7ada
backport: Extend background_psql() to be able to start asynchronously

This is a backport of ba08edb0654. Originally it was only applied to master,
but I (Andres) am planning to fix a few bugs in BackgroundPsql, which would be
somewhat harder with the behavioural differences across branches. It's also
generally good for test infrastructure to behave similarly across branches, to
avoid pain during backpatching.

Discussion: https://postgr.es/m/ilcctzb5ju2gulvnadjmhgatnkxsdpac652byb2u3d3wqziyvx@fbuqcglker46

Michael's original commit message:

This commit extends the constructor routine of BackgroundPsql.pm with a
new "wait" parameter.  If set to 0, the routine returns without waiting
for psql to start, ready to consume input.

background_psql() in Cluster.pm gains the same "wait" parameter.  The
default behavior is still to wait for psql to start.  It becomes now
possible to not wait, giving to TAP scripts the possibility to perform
actions between a BackgroundPsql startup and its wait_connect() call.

Author: Jacob Champion
Discussion: https://postgr.es/m/CAOYmi+=60deN20WDyCoHCiecgivJxr=98s7s7-C8SkXwrCfHXg@mail.gmail.com
src/test/perl/PostgreSQL/Test/BackgroundPsql.pm
src/test/perl/PostgreSQL/Test/Cluster.pm