From 1ddea192f030f1c5244375e31314c634e3fa89d8 Mon Sep 17 00:00:00 2001
From: Jelte Fennema-Nio <postgres@jeltef.nl>
Date: Sat, 26 Sep 2026 14:54:54 +0200
Subject: [PATCH v12 1/2] Check for pg_dump/restore warnings in test_pg_dump

Warnings are unexpected during the pg_dump tests in test_pg_dump. This
makes the test fail when they occur anyway.
---
 src/test/modules/test_pg_dump/t/001_base.pl | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/test/modules/test_pg_dump/t/001_base.pl b/src/test/modules/test_pg_dump/t/001_base.pl
index 3d65ce4497a..dd6a0a3c73f 100644
--- a/src/test/modules/test_pg_dump/t/001_base.pl
+++ b/src/test/modules/test_pg_dump/t/001_base.pl
@@ -938,13 +938,19 @@ foreach my $run (sort keys %pgdump_runs)
 		next;
 	}
 
-	$node->command_ok(\@{ $pgdump_runs{$run}->{dump_cmd} },
-		"$run: pg_dump runs");
+	$node->command_checks_all(
+		\@{ $pgdump_runs{$run}->{dump_cmd} },
+		0, [qr/^/],
+		[qr/^(?!.*pg_dump: warning:)/s],
+		"$run: pg_dump runs without warnings");
 
 	if ($pgdump_runs{$run}->{restore_cmd})
 	{
-		$node->command_ok(\@{ $pgdump_runs{$run}->{restore_cmd} },
-			"$run: pg_restore runs");
+		$node->command_checks_all(
+			\@{ $pgdump_runs{$run}->{restore_cmd} },
+			0, [qr/^/],
+			[qr/^(?!.*pg_restore: warning:)/s],
+			"$run: pg_restore runs without warnings");
 	}
 
 	if ($pgdump_runs{$run}->{test_key})
-- 
2.55.0

