On Tue, Dec 09, 2025 at 10:04:43PM +0200, Heikki Linnakangas wrote:
> 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

Are the dumps of the old versions used in the buildfarm runs updated
with each run?  If yes, forcing a DROP EXTENSION in the problematic
test modules has my favors over the dirtier tricks that would be
required in AdjustUpgrade for the various database name patterns that
depend on the build method.  If no, well, AdjustUpgrade it is with
some DROP DATABASE IF EXISTS.
--
Michael

Attachment: signature.asc
Description: PGP signature

Reply via email to