postgresql/src/test/subscription
Amit Kapila 0c20dd33db Add wait_for_subscription_sync for TAP tests.
The TAP tests for logical replication in src/test/subscription are using
the following code in many places to make sure that the subscription is
synchronized with the publisher:

  $node_publisher->wait_for_catchup('tap_sub');
  $node_subscriber->poll_query_until('postgres',
    qq[SELECT count(1) = 0
       FROM pg_subscription_rel
       WHERE srsubstate NOT IN ('r', 's')]);

The new function wait_for_subscription_sync() can be used to replace the
above code. This eliminates duplicated code and makes it easier to write
future tests.

Author: Masahiko Sawada
Reviewed by: Amit Kapila, Shi yu
Discussion: https://postgr.es/m/CAD21AoC-fvAkaKHa4t1urupwL8xbAcWRePeETvshvy80f6WV1A@mail.gmail.com
2022-08-03 15:31:17 +05:30
..
t Add wait_for_subscription_sync for TAP tests. 2022-08-03 15:31:17 +05:30
.gitignore Logical replication 2017-01-20 09:04:49 -05:00
Makefile Update copyright for 2022 2022-01-07 19:04:57 -05:00
README Doc: improve README files associated with TAP tests. 2021-10-31 18:12:44 -04:00

README

src/test/subscription/README

Regression tests for subscription/logical replication
=====================================================

This directory contains a test suite for subscription/logical replication.

Running the tests
=================

NOTE: You must have given the --enable-tap-tests argument to configure.
Also, to use "make installcheck", you must have built and installed
contrib/hstore in addition to the core code.

Run
    make check
or
    make installcheck
You can use "make installcheck" if you previously did "make install".
In that case, the code in the installation tree is tested.  With
"make check", a temporary installation tree is built from the current
sources and then tested.

Either way, this test initializes, starts, and stops several test Postgres
clusters.

See src/test/perl/README for more info about running these tests.