Commit 200ee426 authored by Toon Claes's avatar Toon Claes

test: Remove GitalySetup#wait method

Prior to this change, when Gitaly was spawned in test, it was twice
checked whether the UNIX socket is open:
- In GitalySetup#start it uses #try_connect! to test the socket.
- In GitalySetup#spawn_gitaly it again called #wait to test the socket
  again.

This change removes #wait and the use of it.
parent 36ded53f
......@@ -274,21 +274,6 @@ module GitalySetup
"unix:" + socket_path(:praefect)
end
def wait(service)
sleep_time = 10
sleep_interval = 0.1
socket = socket_path(service)
Integer(sleep_time / sleep_interval).times do
Socket.unix(socket)
return
rescue StandardError
sleep sleep_interval
end
raise "could not connect to #{service} at #{socket.inspect} after #{sleep_time} seconds"
end
def stop(pid)
Process.kill('KILL', pid)
rescue Errno::ESRCH
......@@ -311,9 +296,6 @@ module GitalySetup
pids = [gitaly_pid, gitaly2_pid, praefect_pid]
pids.each { |pid| stop(pid) }
end
wait('gitaly')
wait('praefect')
rescue StandardError
raise gitaly_failure_message
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment