Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Disable fsync throughout TAP test suites.
authorNoah Misch <noah@leadboat.com>
Thu, 3 Sep 2015 04:29:11 +0000 (00:29 -0400)
committerNoah Misch <noah@leadboat.com>
Thu, 3 Sep 2015 04:29:43 +0000 (00:29 -0400)
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.

src/bin/pg_controldata/t/001_pg_controldata.pl
src/bin/pg_ctl/t/001_start_stop.pl
src/test/perl/TestLib.pm

index e36fa2d45d99ccf404bdd9a896d61c4f0f62e3f8..e2b0d420a23c8d8575b610026733c179a5574ebb 100644 (file)
@@ -11,6 +11,6 @@ program_options_handling_ok('pg_controldata');
 command_fails(['pg_controldata'], 'pg_controldata without arguments fails');
 command_fails([ 'pg_controldata', 'nonexistent' ],
    '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" ],
    qr/checkpoint/, 'pg_controldata produces output');
index bcceb57d7bcdf877a0d0ccf500bcca6720b9a6d0..ff9a09592843e60921782c97ee0556f40fcb7156 100644 (file)
@@ -13,7 +13,8 @@ program_options_handling_ok('pg_ctl');
 command_exit_is([ 'pg_ctl', 'start', '-D', "$tempdir/nonexistent" ],
    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(
    [   "$ENV{top_builddir}/src/test/regress/pg_regress", '--config-auth',
        "$tempdir/data" ],
@@ -21,6 +22,7 @@ command_ok(
 open CONF, ">>$tempdir/data/postgresql.conf";
 print CONF "listen_addresses = ''\n";
 print CONF "unix_socket_directories = '$tempdir_short'\n";
+print CONF "fsync = off\n";
 close CONF;
 command_ok([ 'pg_ctl', 'start', '-D', "$tempdir/data", '-w' ],
    'pg_ctl start -w');
index 5ef95f0246ebe104dba048c972ed5d3ba2b0e033..9402e4462c3a831cb9b1607a87476c33d68530a3 100644 (file)
@@ -123,6 +123,11 @@ sub standard_initdb
    system_or_bail('initdb', '-D', "$pgdata", '-A' , 'trust', '-N');
    system_or_bail("$ENV{top_builddir}/src/test/regress/pg_regress",
        '--config-auth', $pgdata);
+
+   open CONF, ">>$pgdata/postgresql.conf";
+   print CONF "\n# Added by TestLib.pm)\n";
+   print CONF "fsync = off\n";
+   close CONF;
 }
 
 my ($test_server_datadir, $test_server_logfile);
@@ -138,7 +143,7 @@ sub start_test_server
    standard_initdb "$tempdir/pgdata";
    $ret = system_log('pg_ctl', '-D', "$tempdir/pgdata", '-w', '-l',
      "$log_path/postmaster.log", '-o',
-"--fsync=off -k \"$tempdir_short\" --listen-addresses='' --log-statement=all",
+"-k \"$tempdir_short\" --listen-addresses='' --log-statement=all",
                    'start');
    if ($ret != 0)
    {