From 02a598d2fec04e5c5f5185bd07d1f19527900844 Mon Sep 17 00:00:00 2001
From: Mark Dilger <mark.dilger@enterprisedb.com>
Date: Fri, 12 Mar 2021 14:43:19 -0800
Subject: [PATCH v2 1/2] Fixing pg_amcheck regression test portability issue

One of pg_amcheck's regression tests was failing because it was not
accounting for the fact that the exact error message for a
nonexistent role can differ.  The test was expecting a login attempt
with user "no_such_user" would draw an error matching the pattern
/role "no_such_user" does not exist/, but this ignores differences
across machines.  On fairywren, for example, the message actually
seen is:

	SSPI authentication failed for user "no_such_user"

Rather than try to update the test with an exhaustive list of all
possible failure messages, changing the test to merely verify that
the pg_amcheck command fails when given a nonexistent user.
---
 src/bin/pg_amcheck/t/002_nonesuch.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/bin/pg_amcheck/t/002_nonesuch.pl b/src/bin/pg_amcheck/t/002_nonesuch.pl
index b7d41c9b49..fd5f637d7b 100644
--- a/src/bin/pg_amcheck/t/002_nonesuch.pl
+++ b/src/bin/pg_amcheck/t/002_nonesuch.pl
@@ -3,7 +3,7 @@ use warnings;
 
 use PostgresNode;
 use TestLib;
-use Test::More tests => 76;
+use Test::More tests => 75;
 
 # Test set-up
 my ($node, $port);
@@ -68,7 +68,7 @@ $node->command_checks_all(
 	[ 'pg_amcheck', '-U', 'no_such_user', 'postgres' ],
 	1,
 	[ qr/^$/ ],
-	[ qr/role "no_such_user" does not exist/ ],
+	[ ],
 	'checking with a non-existent user');
 
 # Failing to connect to the initial database due to bad username is an still an
-- 
2.21.1 (Apple Git-122.3)

