postgresql/src/test
Michael Paquier 597f66942d injection_points: Fix incorrect spinlock acquisition
Injection points created under injection_points_set_local() are cleaned
up by a shmem_exit() callback.  The spinlock used by the module would
be hold while calling InjectionPointDetach(), which is incorrect as
spinlocks should avoid external calls while hold.

This commit changes the shmem_exit() callback to detach the points in
three steps with the spinlock acquired twice, knowing that the
injection points should be around with the conditions related to them:
- Scans for the points to detach in a first loop, while holding the
spinlock.
- Detach them.
- Remove the registered conditions.

It is still possible for other processes to detach local points
concurrently of the callback.  I have wanted to restrict the detach, but
Noah has mentioned that he has in mind some cases that may require this
capability.  No tests in the tree based on injection points need that
currently.

Thinko in f587338dec.

Reported-by: Noah Misch
Reviewed-by: Noah Misch
Discussion: https://postgr.es/m/20240501231214.40@rfd.leadboat.com
2024-05-06 09:45:46 +09:00
..
authentication Fix an assortment of typos 2024-05-04 02:33:25 +12:00
examples Update copyright for 2024 2024-01-03 20:49:05 -05:00
icu Address more review comments on commit 2d819a08a1. 2024-03-18 11:58:13 -07:00
isolation Fix typos and duplicate words 2024-04-18 21:28:07 +02:00
kerberos Move Kerberos module 2024-04-08 02:49:30 +03:00
ldap Don't clobber test exit code at cleanup in LDAP/Kerberors tests 2024-04-07 20:21:27 +03:00
locale Update copyright for 2024 2024-01-03 20:49:05 -05:00
mb
modules injection_points: Fix incorrect spinlock acquisition 2024-05-06 09:45:46 +09:00
perl Try again to add test coverage for pg_combinebackup w/tablespaces. 2024-04-23 16:33:19 -04:00
recovery Fix the handling of the failover option in subscription commands. 2024-04-23 12:22:30 +05:30
regress Fix query pullup issue with WindowClause runCondition 2024-05-05 12:54:46 +12:00
ssl Revert "Add notBefore and notAfter to SSL cert info display" 2024-03-22 22:58:41 +01:00
subscription Fix typos and duplicate words 2024-04-18 21:28:07 +02:00
Makefile Refactor PG_TEST_EXTRA logic in autoconf build 2022-09-20 11:24:16 -07:00
README Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
meson.build Move libpq encryption negotiation tests 2024-04-12 19:52:37 +03:00

README

PostgreSQL tests
================

This directory contains a variety of test infrastructure as well as some of the
tests in PostgreSQL. Not all tests are here -- in particular, there are more in
individual contrib/ modules and in src/bin.

Not all these tests get run by "make check". Check src/test/Makefile to see
which tests get run automatically.

authentication/
  Tests for authentication (but see also below)

examples/
  Demonstration programs for libpq that double as regression tests via
  "make check"

isolation/
  Tests for concurrent behavior at the SQL level

kerberos/
  Tests for Kerberos/GSSAPI authentication and encryption

ldap/
  Tests for LDAP-based authentication

locale/
  Sanity checks for locale data, encodings, etc

mb/
  Tests for multibyte encoding (UTF-8) support

modules/
  Extensions used only or mainly for test purposes, generally not suitable
  for installing in production databases

perl/
  Infrastructure for Perl-based TAP tests

recovery/
  Test suite for recovery and replication

regress/
  PostgreSQL's main regression test suite, pg_regress

ssl/
  Tests to exercise and verify SSL certificate handling

subscription/
  Tests for logical replication