On Fri, Dec 28, 2018 at 06:19:50PM -0800, Noah Misch wrote: > "env EXTRA_REGRESS_OPTS=--temp-config=SOMEFILE make check" appends the > contents of SOMEFILE to the test cluster's postgresql.conf. I want a similar > feature for TAP suites and other non-pg_regress suites. (My immediate use > case is to raise authentication_timeout and wal_sender_timeout on my buildfarm > animals, which sometimes fail at the defaults.) I'm thinking to do this by > recognizing the PG_TEST_TEMP_CONFIG environment variable as a > whitespace-separated list of file names for appending to postgresql.conf.
Looking more closely, we already have the TEMP_CONFIG variable and apply it to everything except TAP suites. Closing that gap, as attached, is enough. The buildfarm client uses TEMP_CONFIG to implement its extra_config setting, so this will cause extra_config to start applying to TAP suites.
diff --git a/src/bin/pg_ctl/t/001_start_stop.pl b/src/bin/pg_ctl/t/001_start_stop.pl index 50a57d0..0c57e9c 100644 --- a/src/bin/pg_ctl/t/001_start_stop.pl +++ b/src/bin/pg_ctl/t/001_start_stop.pl @@ -33,6 +33,8 @@ else { print $conf "listen_addresses = '127.0.0.1'\n"; } +print $conf TestLib::slurp_file($ENV{TEMP_CONFIG}) + if defined $ENV{TEMP_CONFIG}; close $conf; my $ctlcmd = [ 'pg_ctl', 'start', '-D', "$tempdir/data", '-l', diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm index 8a2c6fc..ce663a1 100644 --- a/src/test/perl/PostgresNode.pm +++ b/src/test/perl/PostgresNode.pm @@ -482,6 +482,9 @@ sub init print $conf "unix_socket_directories = '$host'\n"; print $conf "listen_addresses = ''\n"; } + + print $conf TestLib::slurp_file($ENV{TEMP_CONFIG}) + if defined $ENV{TEMP_CONFIG}; close $conf; chmod($self->group_access ? 0640 : 0600, "$pgdata/postgresql.conf")