Fix rare failure in LDAP tests.
authorThomas Munro <[email protected]>
Mon, 3 Aug 2020 00:39:15 +0000 (12:39 +1200)
committerThomas Munro <[email protected]>
Mon, 3 Aug 2020 00:49:36 +0000 (12:49 +1200)
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- to 11, where the LDAP tests arrived.

Reviewed-by: Noah Misch <[email protected]>
Discussion: https://postgr.es/m/CA%2BhUKGLFmW%2BHQYPeKiwSp5sdFFHtFViCpw4Mh6yAgEx74r5-Cw%40mail.gmail.com

src/test/ldap/t/001_auth.pl

index f8941144f5e14e6f83a389480ea7c7e7df6016f3..3bc7672451ec88d8a39e42625079ab98b7b01c44 100644 (file)
@@ -165,7 +165,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;
 }