diff --git a/spec/helpers.rb b/spec/helpers.rb index a17d9a556..340e29cc4 100644 --- a/spec/helpers.rb +++ b/spec/helpers.rb @@ -251,7 +251,6 @@ def initialize(name, port: 23456, postgresql_conf: '') def create_test_db trace "Creating the test DB" - log_and_run @logfile, pg_bin_path('psql'), '-p', @port.to_s, '-e', '-c', 'DROP DATABASE IF EXISTS test', 'postgres' log_and_run @logfile, pg_bin_path('createdb'), '-p', @port.to_s, '-e', 'test' end @@ -276,12 +275,10 @@ def ca_file private def setup_cluster(postgresql_conf) - return if (@pgdata+"ruby-pg-server-cert").exist? - FileUtils.rm_rf(@pgdata, verbose: $DEBUG) trace "Running initdb" - log_and_run @logfile, pg_bin_path('initdb'), '-E', 'UTF8', '--no-locale', '-D', @pgdata.to_s + log_and_run @logfile, pg_bin_path('initdb'), '-E', 'UTF8', '--no-locale', '--no-sync', '-D', @pgdata.to_s trace "Enable SSL" # Enable SSL in server config @@ -291,6 +288,7 @@ def setup_cluster(postgresql_conf) ssl_ca_file = 'ruby-pg-ca-cert' ssl_cert_file = 'ruby-pg-server-cert' ssl_key_file = 'ruby-pg-server-key' +fsync = off #{postgresql_conf} EOT end