From abe8f071259344a153aa90450def4feffacd2f8b Mon Sep 17 00:00:00 2001 From: Andreas Karlsson Date: Wed, 14 Jan 2026 13:26:02 +0100 Subject: [PATCH] Remove unnecessary sleep after pg_ctl start in test suite The pg_ctl start -w command already waits for PostgreSQL to be ready to accept connections before returning so waiting two more seconds does not help. Instead it wastes a total of 6 seconds for a whole run of the test suite. --- spec/helpers.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/helpers.rb b/spec/helpers.rb index 992f53265..b279e0346 100644 --- a/spec/helpers.rb +++ b/spec/helpers.rb @@ -309,7 +309,6 @@ def initialize( name, port: 23456, postgresql_conf: '' ) sopt += " -k #{@test_dir.to_s.dump}" unless RUBY_PLATFORM=~/mingw|mswin/i log_and_run @logfile, pg_bin_path('pg_ctl'), '-w', '-o', sopt, '-D', @pgdata.to_s, 'start' - sleep 2 td = @pgdata @conninfo = "host=localhost port=#{@port} dbname=test sslrootcert=#{td + 'ruby-pg-ca-cert'} sslcert=#{td + 'ruby-pg-client-cert'} sslkey=#{td + 'ruby-pg-client-key'}"