pgsql: worker_spi: Switch to TAP tests

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема pgsql: worker_spi: Switch to TAP tests
Дата
Msg-id E1qOse2-001XPW-5j@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
worker_spi: Switch to TAP tests

This commit moves worker_spi to use TAP tests.  sql/worker_spi.sql is
gone, replaced by an equivalent set of queries in a TAP script, without
worker_spi loaded in shared_preload_libraries:
- One query to launch a worker dynamically, relying now on "postgres" as
the default database to connect to.
- Two wait queries with poll_query_until(), one to wait for the worker
schema to be initialized and a second to wait for a tuple processed by
the worker.
- Server reload to accelerate the main loop of the spawned worker.

More coverage is added for workers registered when the library is loaded
with shared_preload_libraries, while on it, checking that these are
connecting to the database set in the GUC worker_spi.database.

A local run of these test is showing that TAP is slightly faster than
the original, while providing more coverage (3.7s vs 4.4s).  There was
also some discussions about keeping the SQL tests, but this would
require initializing twice a cluster, increasing the runtime of the
tests up to 5.6s here.

These tests will be expanded more in an upcoming patch aimed at adding
support for custom wait events for the Extension class, still under
discussion, to check the new in-core APIs with and without a library set
in shared_preload_libraries.

Bharath has written the part where shared_preload_libraries is used,
while I have migrated the existing SQL tests to TAP.

Author: Bharath Rupireddy, Michael Paquier
Reviewed-by: Masahiro Ikeda
Discussion: https://postgr.es/m/CALj2ACWR9ncAiDF73unqdJF1dmsA2R0efGXX2624X+YVxcAVWg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/320c311fda912226bcb2e82b507b498161581dd2

Modified Files
--------------
src/test/modules/worker_spi/.gitignore             |  2 -
src/test/modules/worker_spi/Makefile               |  8 +--
src/test/modules/worker_spi/dynamic.conf           |  2 -
.../modules/worker_spi/expected/worker_spi.out     | 50 --------------
src/test/modules/worker_spi/meson.build            |  9 +--
src/test/modules/worker_spi/sql/worker_spi.sql     | 35 ----------
src/test/modules/worker_spi/t/001_worker_spi.pl    | 80 ++++++++++++++++++++++
7 files changed, 84 insertions(+), 102 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: David Rowley
Дата:
Сообщение: pgsql: Fix performance problem with new COPY DEFAULT code
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Raise fixed token-length limit in hba.c.