From e69b0663637df544cc55167b185c124b9823f7fd Mon Sep 17 00:00:00 2001
From: Daniel Gustafsson <dgustafsson@postgresql.org>
Date: Sat, 26 Nov 2022 20:58:09 +0100
Subject: [PATCH v1] Consider a failed test process as a failed test

Commit 55de145d1cf added reporting of child process failures, but the
test suite is still allowed to pass even if the process failed. Since
regress tests are higher level tests, a false positive is more likely
in this case so report failed test processes as failed tests.

Reported-by: Andres Freund <andres@anarazel.de>
Discussion: tbd
Discussion: https://postgr.es/m/20221122235636.4frx7hjterq6bmls@awork3.anarazel.de
---
 src/test/regress/pg_regress.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
index dda076847a..ddd2182f1d 100644
--- a/src/test/regress/pg_regress.c
+++ b/src/test/regress/pg_regress.c
@@ -1713,7 +1713,7 @@ run_schedule(const char *schedule, test_start_function startfunc,
 				differ |= newdiff;
 			}
 
-			if (differ)
+			if (differ || statuses[i] != 0)
 			{
 				bool		ignore = false;
 				_stringlist *sl;
@@ -1815,7 +1815,7 @@ run_single_test(const char *test, test_start_function startfunc,
 		differ |= newdiff;
 	}
 
-	if (differ)
+	if (differ || exit_status != 0)
 	{
 		status(_("FAILED"));
 		fail_count++;
-- 
2.32.1 (Apple Git-133)

