Skip to content

Commit 7d7a103

Browse files
committed
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.
1 parent a09009e commit 7d7a103

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/bin/pg_controldata/t/001_pg_controldata.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
command_fails(['pg_controldata'], 'pg_controldata without arguments fails');
1212
command_fails([ 'pg_controldata', 'nonexistent' ],
1313
'pg_controldata with nonexistent directory fails');
14-
system_or_bail 'initdb', '-D', "$tempdir/data", '-A', 'trust';
14+
standard_initdb "$tempdir/data";
1515
command_like([ 'pg_controldata', "$tempdir/data" ],
1616
qr/checkpoint/, 'pg_controldata produces output');

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@
1414
command_exit_is([ 'pg_ctl', 'start', '-D', "$tempdir/nonexistent" ],
1515
1, 'pg_ctl start with nonexistent directory');
1616

17-
command_ok([ 'pg_ctl', 'initdb', '-D', "$tempdir/data" ], 'pg_ctl initdb');
17+
command_ok([ 'pg_ctl', 'initdb', '-D', "$tempdir/data", '-o', '-N' ],
18+
'pg_ctl initdb');
1819
command_ok(
1920
[ $ENV{PG_REGRESS}, '--config-auth',
2021
"$tempdir/data" ],
2122
'configure authentication');
2223
open CONF, ">>$tempdir/data/postgresql.conf";
24+
print CONF "fsync = off\n";
2325
if (! $windows_os)
2426
{
2527
print CONF "listen_addresses = ''\n";

src/test/perl/TestLib.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ sub standard_initdb
143143

144144
open CONF, ">>$pgdata/postgresql.conf";
145145
print CONF "\n# Added by TestLib.pm)\n";
146+
print CONF "fsync = off\n";
146147
if ($windows_os)
147148
{
148149
print CONF "listen_addresses = '127.0.0.1'\n";
@@ -189,7 +190,7 @@ sub start_test_server
189190
standard_initdb "$tempdir/pgdata";
190191

191192
$ret = system_log('pg_ctl', '-D', "$tempdir/pgdata", '-w', '-l',
192-
"$log_path/postmaster.log", '-o', "--fsync=off --log-statement=all",
193+
"$log_path/postmaster.log", '-o', "--log-statement=all",
193194
'start');
194195

195196
if ($ret != 0)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy