injection_points-tests-as-TAP.patch

text/x-patch

Filename: injection_points-tests-as-TAP.patch
Type: text/x-patch
Part: 0
Message: Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY
diff --git a/src/test/modules/injection_points/Makefile b/src/test/modules/injection_points/Makefile
index 7b3c0c4b716..46566937d81 100644
--- a/src/test/modules/injection_points/Makefile
+++ b/src/test/modules/injection_points/Makefile
@@ -11,10 +11,10 @@ EXTENSION = injection_points
 DATA = injection_points--1.0.sql
 PGFILEDESC = "injection_points - facility for injection points"
 
-REGRESS = injection_points hashagg reindex_conc vacuum
+XREGRESS = injection_points hashagg reindex_conc vacuum
 REGRESS_OPTS = --dlpath=$(top_builddir)/src/test/regress
 
-ISOLATION = basic \
+XISOLATION = basic \
 	    inplace \
 	    syscache-update-pruned \
 	    index-concurrently-upsert \
@@ -28,6 +28,9 @@ NO_INSTALLCHECK = 1
 
 export enable_injection_points
 
+REGRESS_SHLIB=$(abs_top_builddir)/src/test/regress/regress$(DLSUFFIX)
+export REGRESS_SHLIB
+
 ifdef USE_PGXS
 PG_CONFIG = pg_config
 PGXS := $(shell $(PG_CONFIG) --pgxs)
diff --git a/src/test/modules/injection_points/isolation_schedule b/src/test/modules/injection_points/isolation_schedule
new file mode 100644
index 00000000000..9b71d065309
--- /dev/null
+++ b/src/test/modules/injection_points/isolation_schedule
@@ -0,0 +1,23 @@
+test: basic
+test: inplace
+test: syscache-update-pruned
+test: index-concurrently-upsert
+test: index-concurrently-upsert
+test: index-concurrently-upsert
+test: index-concurrently-upsert
+test: index-concurrently-upsert
+test: index-concurrently-upsert
+test: index-concurrently-upsert
+test: index-concurrently-upsert
+test: index-concurrently-upsert
+test: index-concurrently-upsert
+test: reindex-concurrently-upsert
+test: reindex-concurrently-upsert
+test: reindex-concurrently-upsert
+test: reindex-concurrently-upsert
+test: reindex-concurrently-upsert
+test: reindex-concurrently-upsert
+test: reindex-concurrently-upsert
+test: reindex-concurrently-upsert
+test: reindex-concurrently-upsert
+test: reindex-concurrently-upsert
diff --git a/src/test/modules/injection_points/t/099_isolation_regress.pl b/src/test/modules/injection_points/t/099_isolation_regress.pl
new file mode 100644
index 00000000000..047530c3d6a
--- /dev/null
+++ b/src/test/modules/injection_points/t/099_isolation_regress.pl
@@ -0,0 +1,55 @@
+
+# Copyright (c) 2024, PostgreSQL Global Development Group
+
+# Run the standard regression tests with streaming replication
+use strict;
+use warnings FATAL => 'all';
+use PostgreSQL::Test::Cluster;
+use PostgreSQL::Test::Utils;
+use Test::More;
+use File::Basename;
+
+# Initialize primary node
+my $node_primary = PostgreSQL::Test::Cluster->new('primary');
+$node_primary->init();
+
+# Increase some settings that Cluster->new makes too low by default.
+$node_primary->adjust_conf('postgresql.conf', 'max_connections', '25');
+$node_primary->append_conf('postgresql.conf',
+	'max_prepared_transactions = 10');
+
+$node_primary->start;
+
+my $dlpath = dirname($ENV{REGRESS_SHLIB});
+my $outputdir = $PostgreSQL::Test::Utils::tmp_check;
+
+# Run the regression tests against the primary.
+my $extra_opts = $ENV{EXTRA_REGRESS_OPTS} || "";
+
+my $rc =
+  system( ($ENV{PG_REGRESS} =~ s/regress\/pg_regress/isolation\/pg_isolation_regress/r)
+	  . " $extra_opts "
+	  . "--dlpath=\"$dlpath\" "
+	  . "--bindir= "
+	  . "--host="
+	  . $node_primary->host . " "
+	  . "--port="
+	  . $node_primary->port . " "
+	  . "--schedule=./isolation_schedule "
+	  . "--inputdir=./ "
+	  . "--outputdir=\"$outputdir\"");
+if ($rc != 0)
+{
+	# Dump out the regression diffs file, if there is one
+	my $diffs = "$outputdir/regression.diffs";
+	if (-e $diffs)
+	{
+		print "=== dumping $diffs ===\n";
+		print slurp_file($diffs);
+		print "=== EOF ===\n";
+	}
+}
+is($rc, 0, 'regression tests pass');
+
+
+done_testing();