summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Berg2016-06-05 12:32:09 +0000
committerChristoph Berg2016-06-05 16:24:52 +0000
commit755994d839a0d05ade7eeb8fe984eb36bd78e565 (patch)
tree1f09dd2d8ba65d20edd38dcc7ae41633e9a2bcf8
parent61dc82c8b4f527eb117604cba6c2cca88f777931 (diff)
Speed up testing by disabling fsync
-rw-r--r--t/CP_Testing.pm18
1 files changed, 12 insertions, 6 deletions
diff --git a/t/CP_Testing.pm b/t/CP_Testing.pm
index 7d4b6e9a3..248c9d3e2 100644
--- a/t/CP_Testing.pm
+++ b/t/CP_Testing.pm
@@ -92,6 +92,17 @@ sub test_database_handle {
: $ENV{PGBINDIR} ? "$ENV{PGBINDIR}/initdb"
: 'initdb';
+ ## Grab the version for finicky items
+ if (qx{$initdb --version} !~ /(\d+)\.(\d+)/) {
+ die qq{Could not determine the version of initdb in use!\n};
+ }
+ my ($imaj,$imin) = ($1,$2);
+
+ # Speed up testing on 9.3+
+ if ($imaj > 9 or ($imaj==9 and $imin >= 3)) {
+ $initdb = "$initdb --nosync";
+ }
+
$com = qq{LC_ALL=en LANG=C $initdb --locale=C -E UTF8 -D "$datadir" 2>&1};
eval {
$DEBUG and warn qq{About to run: $com\n};
@@ -108,12 +119,7 @@ sub test_database_handle {
print $cfh qq{port = 5432\n};
print $cfh qq{listen_addresses = ''\n};
print $cfh qq{max_connections = 10\n};
-
- ## Grab the version for finicky items
- if (qx{$initdb --version} !~ /(\d+)\.(\d+)/) {
- die qq{Could not determine the version of initdb in use!\n};
- }
- my ($imaj,$imin) = ($1,$2);
+ print $cfh qq{fsync = off\n};
## <= 8.0
if ($imaj < 8 or ($imaj==8 and $imin <= 1)) {