Re: pgsql: injection_points: Remove portions related to custom pgstats - Mailing list pgsql-committers

From Heikki Linnakangas
Subject Re: pgsql: injection_points: Remove portions related to custom pgstats
Date
Msg-id ebfa8b0a-5858-4167-884c-499e70fce2cd@iki.fi
Whole thread Raw
In response to Re: pgsql: injection_points: Remove portions related to custom pgstats  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pgsql: injection_points: Remove portions related to custom pgstats
List pgsql-committers
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




pgsql-committers by date:

Previous
From: Nathan Bossart
Date:
Subject: pgsql: Add ParallelSlotSetIdle().
Next
From: Thomas Munro
Date:
Subject: pgsql: Fix O_CLOEXEC flag handling in Windows port.