From c2c9d6756deaea91c60de8043a742c391a9e3f30 Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Wed, 7 Apr 2021 19:59:41 +0900 Subject: [PATCH] Fix potential rare failure in the kerberos TAP tests Instead of writing a query to psql's stdin, which can cause a failure where psql exits before writing, reporting a write failure with a broken pipe, this changes the logic to use -c. This was not seen in the buildfarm as no animals with a sensitive environment are running the kerberos tests, but let's be safe. HEAD is able to handle the situation as of 6d41dd0 for all the test suites doing connection checks. f44b9b6 has fixed the same problem for the LDAP tests. Discussion: https://postgr.es/m/YGu7ceWAiSNQDgH5@paquier.xyz Backpatch-through: 11 --- src/test/kerberos/t/001_auth.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/test/kerberos/t/001_auth.pl b/src/test/kerberos/t/001_auth.pl index ff697e29a27..9e0a2150dee 100644 --- a/src/test/kerberos/t/001_auth.pl +++ b/src/test/kerberos/t/001_auth.pl @@ -163,11 +163,12 @@ sub test_access # need to connect over TCP/IP for Kerberos my $res = $node->psql( 'postgres', - 'SELECT 1', + undef, extra_params => [ '-d', $node->connstr('postgres') . " host=$host hostaddr=$hostaddr", - '-U', $role + '-U', $role, + '-c', 'SELECT 1' ]); is($res, $expected_res, $test_name); return; -- 2.39.5