On 09/12/2025 19:40, Tom Lane wrote:
Perhaps another alternative is to add "DROP EXTENSION
injection_points" at the end of the test scripts in the
problematic modules.

It's a little tricky if a module has more than one test that uses the extension. Namely src/test/modules/nbtree which I added recently has two test scripts, nbtree_incomplete_splits.sql and nbtree_half_dead_pages.sql, and both of them do "create extension if not exists injection_points;". They run concurrently, so they race on which one creates the extension first. We can't do the same for DROP EXTENSION at the end.

Maybe that's not a great design in the first place, though. Perhaps that module should use a schedule file:

# create injection_points extension before the actual tests
test: test_setup

test: nbtree_incomplete_splits nbtree_half_dead_pages

# drop injection_points extension because it cannot be pg_upgraded.
test: test_clean

- Heikki



Reply via email to