postgresql/src/test/modules/injection_points
Michael Paquier f4083c4975 injection_points: Fix race condition with local injection point tests
The module relies on a shmem exit callback to clean up any injection
points linked to a specific process.  One of the tests checks for the
case of an injection point name reused in a second connection where the
first connection should clean it up, but it did not count for the fact
that the shmem exit callback of the first connection may not have run
when the second connection begins its work.

The regress library includes a wait_pid() that can be used for this
purpose, instead of a custom wait logic, so let's rely on it to wait for
the first connection to exit before working with the second connection.
The module gains a REGRESS_OPTS to be able to look at the regress
library's dlpath.

This issue could be reproduced with a hardcoded sleep() in the shmem
exit callback, and the CI has been able to trigger it sporadically.

Oversight in f587338dec.

Reported-by: Bharath Rupireddy
Reviewed-by: Andrey Borodin
Discussion: https://postgr.es/m/ZhOd3NXAutteokGL@paquier.xyz
2024-04-09 10:31:12 +09:00
..
expected injection_points: Fix race condition with local injection point tests 2024-04-09 10:31:12 +09:00
sql injection_points: Fix race condition with local injection point tests 2024-04-09 10:31:12 +09:00
.gitignore Add test module injection_points 2024-01-22 13:32:28 +09:00
Makefile injection_points: Fix race condition with local injection point tests 2024-04-09 10:31:12 +09: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 injection_points: Fix race condition with local injection point tests 2024-04-09 10:31:12 +09:00