1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-21 10:42:50 +03:00

Avoid and detect SIGPIPE race in TAP tests.

Don't write to stdin of a psql process that could have already exited
with an authentication failure.  Buildfarm members crake and mandrill
have failed once by doing so.  Ignore SIGPIPE in all TAP tests.
Back-patch to v10, where these tests were introduced.

Reviewed by Michael Paquier.

Discussion: https://postgr.es/m/20171209210203.GC3362632@rfd.leadboat.com
This commit is contained in:
Noah Misch
2017-12-16 10:03:35 -08:00
parent 997071691f
commit c757a3da0a
3 changed files with 6 additions and 4 deletions

View File

@@ -44,8 +44,7 @@ sub test_role
$status_string = 'success' if ($expected_res eq 0);
my $res =
$node->psql('postgres', 'SELECT 1', extra_params => [ '-U', $role ]);
my $res = $node->psql('postgres', undef, extra_params => [ '-U', $role ]);
is($res, $expected_res,
"authentication $status_string for method $method, role $role");
}

View File

@@ -41,8 +41,7 @@ sub test_login
$status_string = 'success' if ($expected_res eq 0);
$ENV{"PGPASSWORD"} = $password;
my $res =
$node->psql('postgres', 'SELECT 1', extra_params => [ '-U', $role ]);
my $res = $node->psql('postgres', undef, extra_params => [ '-U', $role ]);
is($res, $expected_res,
"authentication $status_string for role $role with password $password"
);