injection_points: Introduce runtime conditions
Michael Paquier <michael@paquier.xyz>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/test/modules/injection_points/expected/injection_points.out | modified | +77 −0 |
| src/test/modules/injection_points/injection_points--1.0.sql | modified | +11 −0 |
| src/test/modules/injection_points/injection_points.c | modified | +176 −0 |
| src/test/modules/injection_points/sql/injection_points.sql | modified | +20 −0 |
| src/tools/pgindent/typedefs.list | modified | +1 −0 |
Discussion
- Weird test mixup 52 messages · 2024-03-14 → 2024-05-12