]> granicus.if.org Git - postgresql/commitdiff
Honor TEMP_CONFIG in TAP suites.
authorNoah Misch <noah@leadboat.com>
Sat, 11 May 2019 07:22:38 +0000 (00:22 -0700)
committerNoah Misch <noah@leadboat.com>
Sat, 11 May 2019 07:23:02 +0000 (00:23 -0700)
The buildfarm client uses TEMP_CONFIG to implement its extra_config
setting.  Except for stats_temp_directory, extra_config now applies to
TAP suites; extra_config values seen in the past month are compatible
with this.  Back-patch to 9.6, where PostgresNode was introduced, so the
buildfarm can rely on it sooner.

Reviewed by Andrew Dunstan and Tom Lane.

Discussion: https://postgr.es/m/20181229021950.GA3302966@rfd.leadboat.com

src/bin/pg_ctl/t/001_start_stop.pl
src/test/perl/PostgresNode.pm

index 5da4746cb40dfede55bbd1cd93165125790a5167..eb01a32c6194906119225ac2a41c2b0d0f830ba2 100644 (file)
@@ -22,6 +22,8 @@ command_ok([ $ENV{PG_REGRESS}, '--config-auth', "$tempdir/data" ],
        'configure authentication');
 open my $conf, '>>', "$tempdir/data/postgresql.conf";
 print $conf "fsync = off\n";
+print $conf TestLib::slurp_file($ENV{TEMP_CONFIG})
+  if defined $ENV{TEMP_CONFIG};
 if (!$windows_os)
 {
        print $conf "listen_addresses = ''\n";
index f502f698274d014d438deb83b46a6e92e29d8a69..60980e5cda7d5e02cda058f547009529b050c6a1 100644 (file)
@@ -422,7 +422,17 @@ sub init
        print $conf "log_line_prefix = '%m [%p] %q%a '\n";
        print $conf "log_statement = all\n";
        print $conf "wal_retrieve_retry_interval = '500ms'\n";
-       print $conf "port = $port\n";
+
+       # If a setting tends to affect whether tests pass or fail, print it after
+       # TEMP_CONFIG.  Otherwise, print it before TEMP_CONFIG, thereby permitting
+       # overrides.  Settings that merely improve performance or ease debugging
+       # belong before TEMP_CONFIG.
+       print $conf TestLib::slurp_file($ENV{TEMP_CONFIG})
+         if defined $ENV{TEMP_CONFIG};
+
+       # XXX Neutralize any stats_temp_directory in TEMP_CONFIG.  Nodes running
+       # concurrently must not share a stats_temp_directory.
+       print $conf "stats_temp_directory = 'pg_stat_tmp'\n";
 
        if ($params{allows_streaming})
        {
@@ -449,6 +459,7 @@ sub init
                print $conf "max_wal_senders = 0\n";
        }
 
+       print $conf "port = $port\n";
        if ($use_tcp)
        {
                print $conf "unix_socket_directories = ''\n";