Commit 632c5e7b authored by Stan Hu's avatar Stan Hu

Use absolute UNIX socket paths for test Gitaly processes in CI

Instead of using relative paths, we use absolute paths for the Gitaly
processes run in CI. This attempts to rule out relative path issues are
causing random spec failures in
https://gitlab.com/gitlab-org/gitlab/-/issues/297359.
parent 1cd9ee31
...@@ -192,7 +192,17 @@ module TestEnv ...@@ -192,7 +192,17 @@ module TestEnv
end end
def gitaly_dir def gitaly_dir
File.dirname(gitaly_socket_path) socket_path = gitaly_socket_path
socket_path = File.expand_path(gitaly_socket_path) if expand_path?
File.dirname(socket_path)
end
# Linux fails with "bind: invalid argument" if a UNIX socket path exceeds 108 characters:
# https://github.com/golang/go/issues/6895. We use absolute paths in CI to ensure
# that changes in the current working directory don't affect GRPC reconnections.
def expand_path?
!!ENV['CI']
end end
def start_gitaly(gitaly_dir) def start_gitaly(gitaly_dir)
......
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