Skip to content

Commit 4d41823

Browse files
committed
Make new authentication test case more robust.
I happened to notice that the new test case I added in b55b4da falls over if one runs "make check" repeatedly; though not in branches after v10. That's because it was assuming that tmp_check/pgpass wouldn't exist already. However, it's only been since v11 that the Makefiles forcibly remove all of tmp_check/ before starting a TAP run. This fix to unlink the file is therefore strictly necessary only in v10 ... but it seems wisest to do it across the board, rather than let the test rely on external logic to get the conditions right.
1 parent c8746f9 commit 4d41823

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/test/authentication/t/001_password.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ sub test_role
107107
delete $ENV{"PGCHANNELBINDING"};
108108
$ENV{"PGPASSFILE"} = $pgpassfile;
109109

110+
unlink($pgpassfile);
110111
append_to_file($pgpassfile, qq!
111112
# This very long comment is just here to exercise handling of long lines in the file. This very long comment is just here to exercise handling of long lines in the file. This very long comment is just here to exercise handling of long lines in the file. This very long comment is just here to exercise handling of long lines in the file. This very long comment is just here to exercise handling of long lines in the file.
112113
*:*:postgres:scram_role:pass:this is not part of the password.

0 commit comments

Comments
 (0)