postgresql/src/test/modules/injection_points
Michael Paquier f587338dec injection_points: Introduce runtime conditions
This adds a new SQL function injection_points_set_local() that can be
used to force injection points to be run only in the process where they
are attached.  This is handy for SQL tests to:
- Detach automatically injection points when the process exits.
- Allow tests with injection points to run concurrently with other test
suites, so as such modules do not have to be marked with
NO_INSTALLCHECK.

Currently, the only condition that can be registered is for a PID.
This could be extended to more kinds later, if required, like database
names/OIDs, roles, or more concepts I did not consider.

Using a single function for SQL scripts is an idea from Heikki
Linnakangas.

Reviewed-by: Andrey Borodin
Discussion: https://postgr.es/m/ZfP7IDs9TvrKe49x@paquier.xyz
2024-04-08 09:47:50 +09:00
..
expected injection_points: Introduce runtime conditions 2024-04-08 09:47:50 +09:00
sql injection_points: Introduce runtime conditions 2024-04-08 09:47:50 +09:00
.gitignore Add test module injection_points 2024-01-22 13:32:28 +09:00
Makefile Try to unbreak injection-fault tests in the buildfarm 2024-03-15 15:22:12 +02:00
injection_points--1.0.sql injection_points: Introduce runtime conditions 2024-04-08 09:47:50 +09:00
injection_points.c injection_points: Introduce runtime conditions 2024-04-08 09:47:50 +09:00
injection_points.control Add test module injection_points 2024-01-22 13:32:28 +09:00
meson.build Disable tests using injection points in installcheck 2024-03-15 13:06:57 +02:00