Commit 6e968924 authored by Stan Hu's avatar Stan Hu

Use different Gitaly internal socket dirs in tests

In tests, we spin up two Gitaly processes along a Praefect process.
However, the Gitaly processes were sharing the same internal socket
directory to manage their gitaly-ruby subprocesses, which might cause
signals to be crossed.

Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/297359
parent a9cda936
......@@ -162,6 +162,7 @@ setup-test-env:
- tmp/tests/gitaly/gitaly-lfs-smudge
- tmp/tests/gitaly/gitaly-ssh
- tmp/tests/gitaly/internal/
- tmp/tests/gitaly/internal_gitaly2/
- tmp/tests/gitaly/internal_sockets/
- tmp/tests/gitaly/Makefile
- tmp/tests/gitaly/praefect
......
......@@ -115,7 +115,7 @@ module Gitlab
config[:storage] = storages
internal_socket_dir = File.join(gitaly_dir, 'internal_sockets')
internal_socket_dir = options[:internal_socket_dir] || File.join(gitaly_dir, 'internal_sockets')
FileUtils.mkdir(internal_socket_dir) unless File.exist?(internal_socket_dir)
config[:internal_socket_dir] = internal_socket_dir
......
......@@ -172,8 +172,13 @@ module TestEnv
Gitlab::SetupHelper::Gitaly.create_configuration(gitaly_dir, { 'default' => repos_path }, force: true)
Gitlab::SetupHelper::Gitaly.create_configuration(
gitaly_dir,
{ 'default' => repos_path }, force: true,
options: { gitaly_socket: "gitaly2.socket", config_filename: "gitaly2.config.toml" }
{ 'default' => repos_path },
force: true,
options: {
internal_socket_dir: File.join(gitaly_dir, "internal_gitaly2"),
gitaly_socket: "gitaly2.socket",
config_filename: "gitaly2.config.toml"
}
)
Gitlab::SetupHelper::Praefect.create_configuration(gitaly_dir, { 'praefect' => repos_path }, force: true)
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