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:
authorSami Hiltunen <shiltunen@gitlab.com>2023-10-09 21:24:51 +0300
committerSami Hiltunen <shiltunen@gitlab.com>2023-10-11 09:27:32 +0300
commit74467c9debcef7c3632aa917729181f7ddf0c17d (patch)
treeba7147e7086a8a91ca2fe154042661ff2f85ec60 /internal/praefect
parentb5a172e7e46d15e1f22019e328d9b90f17a347e6 (diff)
Setup repository correctly in TestCoordinator_grpcErrorHandling
TestCoordinator_grpcErrorHandling is not creating the test repository on the Gitaly storages configured as part of a virtual storage. This causes the test to fail when WAL is enabled as the UserCreateBranch errors with unexpected error due to the repository not existing. Setup the repository in the storages to avoid this.
Diffstat (limited to 'internal/praefect')
-rw-r--r--internal/praefect/coordinator_test.go18
1 files changed, 11 insertions, 7 deletions
diff --git a/internal/praefect/coordinator_test.go b/internal/praefect/coordinator_test.go
index 07a658090..8f781ed01 100644
--- a/internal/praefect/coordinator_test.go
+++ b/internal/praefect/coordinator_test.go
@@ -2131,11 +2131,7 @@ func TestCoordinator_grpcErrorHandling(t *testing.T) {
}
ctx := testhelper.Context(t)
- cfg := testcfg.Build(t)
-
- repoProto, _ := gittest.CreateRepository(t, ctx, cfg, gittest.CreateRepositoryConfig{
- SkipCreationViaService: true,
- })
+ relativePath := gittest.NewRepositoryName(t)
for _, tc := range []struct {
desc string
@@ -2176,6 +2172,11 @@ func TestCoordinator_grpcErrorHandling(t *testing.T) {
cfg := testcfg.Build(t, testcfg.WithStorages(gitaly))
+ _, _ = gittest.CreateRepository(t, ctx, cfg, gittest.CreateRepositoryConfig{
+ SkipCreationViaService: true,
+ RelativePath: relativePath,
+ })
+
operationServer := &mockOperationServer{
t: t,
wg: &wg,
@@ -2226,7 +2227,7 @@ func TestCoordinator_grpcErrorHandling(t *testing.T) {
// nodes will take part in transactions.
WithRepoStore: datastore.MockRepositoryStore{
GetReplicaPathFunc: func(ctx context.Context, repositoryID int64) (string, error) {
- return repoProto.GetRelativePath(), nil
+ return relativePath, nil
},
GetConsistentStoragesFunc: func(ctx context.Context, virtualStorage, relativePath string) (string, *datastructure.Set[string], error) {
return relativePath, datastructure.SetFromValues("primary", "secondary-1", "secondary-2"), nil
@@ -2243,7 +2244,10 @@ func TestCoordinator_grpcErrorHandling(t *testing.T) {
_, err := gitalypb.NewOperationServiceClient(praefectConn).UserCreateBranch(ctx,
&gitalypb.UserCreateBranchRequest{
- Repository: repoProto,
+ Repository: &gitalypb.Repository{
+ StorageName: testhelper.DefaultStorageName,
+ RelativePath: relativePath,
+ },
})
testhelper.RequireGrpcError(t, tc.expectedErr, err)