Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2021-06-23 15:45:07 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2021-07-08 09:15:15 +0300
commitd92949cc4e961a8c9f0131597fbb352c98471177 (patch)
treeb663a8af22ce70f7feef8d3d6fb1b177279047f6
parenteedefccdd5a236371085ac20f010b27e08814b2f (diff)
praefect: Avoid double-proxied Gitaly nodes
Some of our Praefect server tests use `testserver.RunGitalyServer()` to setup their Gitaly nodes. While this isn't a problem by itself, this function will by default set up a Praefect proxy for the Gitaly nodes if running the "test-with-praefect" target. The result is that Gitaly nodes are proxied by two Praefects: first the one set up by above function, and then the one we're setting up ourselves in the tests. This is not a supported configuration and may cause RPCs to fail in case Gitaly needs to reach out to Praefect, e.g. for transactional voting. Fix the issue by passing the `WithDisablePraefect()` option.
-rw-r--r--internal/praefect/server_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/praefect/server_test.go b/internal/praefect/server_test.go
index 58029904c..7b244e647 100644
--- a/internal/praefect/server_test.go
+++ b/internal/praefect/server_test.go
@@ -247,7 +247,7 @@ func TestDiskStatistics(t *testing.T) {
for _, name := range []string{"gitaly-1", "gitaly-2"} {
gitalyCfg := testcfg.Build(t)
- gitalyAddr := testserver.RunGitalyServer(t, gitalyCfg, nil, setup.RegisterAll)
+ gitalyAddr := testserver.RunGitalyServer(t, gitalyCfg, nil, setup.RegisterAll, testserver.WithDisablePraefect())
praefectCfg.VirtualStorages[0].Nodes = append(praefectCfg.VirtualStorages[0].Nodes, &config.Node{
Storage: name,
@@ -463,7 +463,7 @@ func TestRemoveRepository(t *testing.T) {
cfgBuilder := testcfg.NewGitalyCfgBuilder(testcfg.WithStorages(name))
gitalyCfgs[i], repos[i] = cfgBuilder.BuildWithRepoAt(t, "test-repository")
- gitalyAddr := testserver.RunGitalyServer(t, gitalyCfgs[i], nil, setup.RegisterAll)
+ gitalyAddr := testserver.RunGitalyServer(t, gitalyCfgs[i], nil, setup.RegisterAll, testserver.WithDisablePraefect())
gitalyCfgs[i].SocketPath = gitalyAddr
praefectCfg.VirtualStorages[0].Nodes = append(praefectCfg.VirtualStorages[0].Nodes, &config.Node{
@@ -554,7 +554,7 @@ func TestRenameRepository(t *testing.T) {
repo = repos[0]
}
- gitalyAddr := testserver.RunGitalyServer(t, gitalyCfg, nil, setup.RegisterAll)
+ gitalyAddr := testserver.RunGitalyServer(t, gitalyCfg, nil, setup.RegisterAll, testserver.WithDisablePraefect())
praefectCfg.VirtualStorages[0].Nodes = append(praefectCfg.VirtualStorages[0].Nodes, &config.Node{
Storage: storageName,