postgresql/src/test/recovery/t
Peter Eisentraut 8e93a516e6 Don't propagate PGAPPNAME through pg_ctl in tests
When libpq is loaded in the server (for instance, by
libpqwalreceiver), it may use libpq environment variables set in the
postmaster environment for connection parameter defaults.  This has
some confusing effects in our test suites.  For example, the TAP test
infrastructure sets PGAPPNAME to allow identifying clients in the
server log.  But this environment variable is also inherited by
temporary servers started with pg_ctl and is then in turn used by
libpqwalreceiver as the application_name for connecting to remote
servers where it then shows up in pg_stat_replication and is relevant
for things like synchronous_standby_names.  Replication already has a
suitable default for application_name, and overriding that
accidentally then requires the individual test cases to re-override
that, which is all very confusing and unnecessary.

To fix, unset PGAPPNAME temporarily before running pg_ctl start or
restart in the tests.

More comprehensive approaches like unsetting all environment variables
in pg_ctl were considered but might be too complicated to achieve
portably.

The now unnecessary re-overriding of application_name by test cases is
also removed.

Reviewed-by: Noah Misch <noah@leadboat.com>
Discussion: https://www.postgresql.org/message-id/flat/33383613-690e-6f1b-d5ba-4957ff40f6ce@2ndquadrant.com
2019-03-16 08:58:40 +01:00
..
001_stream_rep.pl Integrate recovery.conf into postgresql.conf 2018-11-25 16:33:40 +01:00
002_archiving.pl Remove uses of "slave" in replication contexts 2017-08-10 22:55:41 -04:00
003_recovery_targets.pl Allow recovery tests to run on Windows as an admin user 2019-03-04 15:54:02 -05:00
004_timeline_switch.pl Don't propagate PGAPPNAME through pg_ctl in tests 2019-03-16 08:58:40 +01:00
005_replay_delay.pl Integrate recovery.conf into postgresql.conf 2018-11-25 16:33:40 +01:00
006_logical_decoding.pl Raise some timeouts to 180s, in test code. 2018-12-10 20:15:42 -08:00
007_sync_rep.pl Don't fall off the end of perl functions 2018-05-27 09:08:42 -04:00
008_fsm_truncation.pl Remove unnecessary pg_is_in_recovery calls in tests 2017-07-05 13:37:08 -04:00
009_twophase.pl Add TAP tests for 2PC post-commit callbacks of multixacts at recovery 2019-02-23 08:19:31 +09:00
010_logical_decoding_timelines.pl Raise some timeouts to 180s, in test code. 2018-12-10 20:15:42 -08:00
011_crash_recovery.pl Restrict vertical tightness to parentheses in Perl code 2018-05-09 10:14:46 -04:00
012_subtransactions.pl Change default of recovery_target_timeline to 'latest' 2019-01-13 10:01:05 +01:00
013_crash_restart.pl Allow for yet another crash symptom in 013_crash_restart.pl. 2019-01-26 22:12:48 -05:00
014_unlogged_reinit.pl Reindent Perl files with perltidy version 20170521. 2018-04-25 14:00:19 -04:00
015_promotion_pages.pl Prevent references to invalid relation pages after fresh promotion 2018-07-05 10:46:18 +09:00
016_min_consistency.pl Fix race condition in recently-added TAP test for recovery consistency 2019-03-14 12:41:45 +09:00