From 664699caa0388ffd73ec2f34b00c587161c00d57 Mon Sep 17 00:00:00 2001
From: Matthias van de Meent <boekewurm@gmail.com>
Date: Wed, 15 Jan 2025 15:39:36 +0000
Subject: [PATCH] Run regression tests with a parallel schedule

This reduces the time it takes to run these tests on systems that have many CPUs available.
---
 Makefile         |  7 +------
 regress_schedule | 12 ++++++++++++
 2 files changed, 13 insertions(+), 6 deletions(-)
 create mode 100644 regress_schedule

diff --git a/Makefile b/Makefile
index ab4ee1df38..f855e51c01 100644
--- a/Makefile
+++ b/Makefile
@@ -25,12 +25,7 @@ RELATIVE_INCLUDES = $(addprefix src/, $(INCLUDES))
 
 LDFLAGS_SL += $(filter -lm, $(LIBS))
 
-REGRESS = security rum rum_validate rum_hash ruminv timestamp orderby orderby_hash \
-	altorder altorder_hash limits \
-	int2 int4 int8 float4 float8 money oid \
-    time timetz date interval \
-    macaddr inet cidr text varchar char bytea bit varbit \
-	numeric rum_weight expr
+REGRESS = --schedule=$(srcdir)/regress_schedule
 
 TAP_TESTS = 1
 
diff --git a/regress_schedule b/regress_schedule
new file mode 100644
index 0000000000..91b587c6fa
--- /dev/null
+++ b/regress_schedule
@@ -0,0 +1,12 @@
+# "security" and "rum" are setup, and must be run sequentially.
+test: security
+test: rum
+
+# up to 20 tests in a single parallel schedule
+test: rum_validate rum_hash ruminv timestamp orderby \
+    orderby_hash altorder altorder_hash limits int2 \
+    int4 int8 float4 float8 money \
+    oid time timetz date interval
+test: macaddr inet cidr text varchar \
+    char bytea bit varbit numeric \
+    rum_weight expr