diff --git a/spec/support/helpers/gitaly_setup.rb b/spec/support/helpers/gitaly_setup.rb
index f4c569c10e7e41916520b695de2190044ee0db7d..e4a477a1f19f829b863a209a0d37917bab672079 100644
--- a/spec/support/helpers/gitaly_setup.rb
+++ b/spec/support/helpers/gitaly_setup.rb
@@ -152,6 +152,7 @@ def start(service, toml = nil)
     begin
       try_connect!(service, toml)
     rescue StandardError
+      process_details(pid)
       Process.kill('TERM', pid)
       raise
     end
@@ -198,7 +199,7 @@ def connect_proc(toml)
 
   def try_connect!(service, toml)
     LOGGER.debug "Trying to connect to #{service}: "
-    timeout = 20
+    timeout = 40
     delay = 0.1
     connect = connect_proc(toml)
 
@@ -407,4 +408,12 @@ def praefect_with_db?
   def gitaly_with_transactions?
     Gitlab::Utils.to_boolean(ENV['GITALY_TRANSACTIONS_ENABLED'], default: false)
   end
+
+  private
+
+  # Logs the details of the process with the given pid.
+  def process_details(pid)
+    output = `ps -p #{pid} -o pid,ppid,state,%cpu,%mem,etime,args`
+    LOGGER.debug output
+  end
 end