Skip to content

Commit 7a6a541

Browse files
committed
Honor TEMP_CONFIG in TAP suites.
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
1 parent c6354e9 commit 7a6a541

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/bin/pg_ctl/t/001_start_stop.pl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
'configure authentication');
2323
open my $conf, '>>', "$tempdir/data/postgresql.conf";
2424
print $conf "fsync = off\n";
25+
print $conf TestLib::slurp_file($ENV{TEMP_CONFIG})
26+
if defined $ENV{TEMP_CONFIG};
2527
if (!$windows_os)
2628
{
2729
print $conf "listen_addresses = ''\n";

src/test/perl/PostgresNode.pm

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,17 @@ sub init
422422
print $conf "log_line_prefix = '%m [%p] %q%a '\n";
423423
print $conf "log_statement = all\n";
424424
print $conf "wal_retrieve_retry_interval = '500ms'\n";
425-
print $conf "port = $port\n";
425+
426+
# If a setting tends to affect whether tests pass or fail, print it after
427+
# TEMP_CONFIG. Otherwise, print it before TEMP_CONFIG, thereby permitting
428+
# overrides. Settings that merely improve performance or ease debugging
429+
# belong before TEMP_CONFIG.
430+
print $conf TestLib::slurp_file($ENV{TEMP_CONFIG})
431+
if defined $ENV{TEMP_CONFIG};
432+
433+
# XXX Neutralize any stats_temp_directory in TEMP_CONFIG. Nodes running
434+
# concurrently must not share a stats_temp_directory.
435+
print $conf "stats_temp_directory = 'pg_stat_tmp'\n";
426436

427437
if ($params{allows_streaming})
428438
{
@@ -449,6 +459,7 @@ sub init
449459
print $conf "max_wal_senders = 0\n";
450460
}
451461

462+
print $conf "port = $port\n";
452463
if ($use_tcp)
453464
{
454465
print $conf "unix_socket_directories = ''\n";

0 commit comments

Comments
 (0)