Commit 7d7a103f authored by Noah Misch's avatar Noah Misch

Disable fsync throughout TAP test suites.

Most suites already did so via start_test_server(), but the pg_rewind,
pg_ctl and pg_controldata suites ran a postmaster or initdb with fsync
enabled.  This halves the pg_rewind suite's runtime on buildfarm member
tern.  It makes tern and that machine's other buildfarm members less
vulnerable to noise failures from postmaster startup overrunning the 60s
pg_ctl timeout.  Back-patch to 9.5, where pg_rewind was introduced.
parent a09009e4
...@@ -11,6 +11,6 @@ program_options_handling_ok('pg_controldata'); ...@@ -11,6 +11,6 @@ program_options_handling_ok('pg_controldata');
command_fails(['pg_controldata'], 'pg_controldata without arguments fails'); command_fails(['pg_controldata'], 'pg_controldata without arguments fails');
command_fails([ 'pg_controldata', 'nonexistent' ], command_fails([ 'pg_controldata', 'nonexistent' ],
'pg_controldata with nonexistent directory fails'); 'pg_controldata with nonexistent directory fails');
system_or_bail 'initdb', '-D', "$tempdir/data", '-A', 'trust'; standard_initdb "$tempdir/data";
command_like([ 'pg_controldata', "$tempdir/data" ], command_like([ 'pg_controldata', "$tempdir/data" ],
qr/checkpoint/, 'pg_controldata produces output'); qr/checkpoint/, 'pg_controldata produces output');
...@@ -14,12 +14,14 @@ program_options_handling_ok('pg_ctl'); ...@@ -14,12 +14,14 @@ program_options_handling_ok('pg_ctl');
command_exit_is([ 'pg_ctl', 'start', '-D', "$tempdir/nonexistent" ], command_exit_is([ 'pg_ctl', 'start', '-D', "$tempdir/nonexistent" ],
1, 'pg_ctl start with nonexistent directory'); 1, 'pg_ctl start with nonexistent directory');
command_ok([ 'pg_ctl', 'initdb', '-D', "$tempdir/data" ], 'pg_ctl initdb'); command_ok([ 'pg_ctl', 'initdb', '-D', "$tempdir/data", '-o', '-N' ],
'pg_ctl initdb');
command_ok( command_ok(
[ $ENV{PG_REGRESS}, '--config-auth', [ $ENV{PG_REGRESS}, '--config-auth',
"$tempdir/data" ], "$tempdir/data" ],
'configure authentication'); 'configure authentication');
open CONF, ">>$tempdir/data/postgresql.conf"; open CONF, ">>$tempdir/data/postgresql.conf";
print CONF "fsync = off\n";
if (! $windows_os) if (! $windows_os)
{ {
print CONF "listen_addresses = ''\n"; print CONF "listen_addresses = ''\n";
......
...@@ -143,6 +143,7 @@ sub standard_initdb ...@@ -143,6 +143,7 @@ sub standard_initdb
open CONF, ">>$pgdata/postgresql.conf"; open CONF, ">>$pgdata/postgresql.conf";
print CONF "\n# Added by TestLib.pm)\n"; print CONF "\n# Added by TestLib.pm)\n";
print CONF "fsync = off\n";
if ($windows_os) if ($windows_os)
{ {
print CONF "listen_addresses = '127.0.0.1'\n"; print CONF "listen_addresses = '127.0.0.1'\n";
...@@ -189,7 +190,7 @@ sub start_test_server ...@@ -189,7 +190,7 @@ sub start_test_server
standard_initdb "$tempdir/pgdata"; standard_initdb "$tempdir/pgdata";
$ret = system_log('pg_ctl', '-D', "$tempdir/pgdata", '-w', '-l', $ret = system_log('pg_ctl', '-D', "$tempdir/pgdata", '-w', '-l',
"$log_path/postmaster.log", '-o', "--fsync=off --log-statement=all", "$log_path/postmaster.log", '-o', "--log-statement=all",
'start'); 'start');
if ($ret != 0) if ($ret != 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment