From 1beb3ac5184fd32e8a1a79f4ace477a9e7ea27a7 Mon Sep 17 00:00:00 2001 From: Thomas Munro Date: Mon, 3 Aug 2020 12:39:15 +1200 Subject: [PATCH] Fix rare failure in LDAP tests. Instead of writing a query to psql's stdin, use -c. This avoids a failure where psql exits before we write, seen a few times on the build farm. Thanks to Tom Lane for the suggestion. Back-patch to 11, where the LDAP tests arrived. Reviewed-by: Noah Misch Discussion: https://postgr.es/m/CA%2BhUKGLFmW%2BHQYPeKiwSp5sdFFHtFViCpw4Mh6yAgEx74r5-Cw%40mail.gmail.com --- src/test/ldap/t/001_auth.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/ldap/t/001_auth.pl b/src/test/ldap/t/001_auth.pl index 6e4cad98e67..992f01a2a50 100644 --- a/src/test/ldap/t/001_auth.pl +++ b/src/test/ldap/t/001_auth.pl @@ -158,7 +158,8 @@ sub test_access my ($node, $role, $expected_res, $test_name) = @_; my $res = - $node->psql('postgres', 'SELECT 1', extra_params => [ '-U', $role ]); + $node->psql('postgres', undef, + extra_params => [ '-U', $role, '-c', 'SELECT 1' ]); is($res, $expected_res, $test_name); return; }