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:
authorJustin Tobler <jtobler@gitlab.com>2023-02-24 19:59:49 +0300
committerJustin Tobler <jtobler@gitlab.com>2023-02-24 19:59:49 +0300
commit770edd2d7f8324da646df478eb271544393316df (patch)
tree7dbbdb6518a1e4187ea0f494bf869a5950627b88 /internal/gitaly/service
parentb9057c53bbb3107f87e1286def5a1977a1521795 (diff)
parentba14537e5412e53695cc3f9c41068c60d03856d1 (diff)
Merge branch 'wc/macos-hook-err' into 'master'qmnguyen0711/fix-find-changed-paths-rpc-performance
hooks: Fix flaky test on MacOS Closes #4806 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5415 Merged-by: Justin Tobler <jtobler@gitlab.com> Approved-by: Pavlo Strokov <pstrokov@gitlab.com> Approved-by: Justin Tobler <jtobler@gitlab.com> Co-authored-by: Will Chandler <wchandler@gitlab.com>
Diffstat (limited to 'internal/gitaly/service')
-rw-r--r--internal/gitaly/service/hook/pack_objects_test.go20
1 files changed, 16 insertions, 4 deletions
diff --git a/internal/gitaly/service/hook/pack_objects_test.go b/internal/gitaly/service/hook/pack_objects_test.go
index a4b562240..8d1344983 100644
--- a/internal/gitaly/service/hook/pack_objects_test.go
+++ b/internal/gitaly/service/hook/pack_objects_test.go
@@ -8,6 +8,7 @@ import (
"fmt"
"io"
"net"
+ "runtime"
"strings"
"sync"
"testing"
@@ -16,6 +17,7 @@ import (
"github.com/prometheus/client_golang/prometheus/testutil"
"github.com/sirupsen/logrus"
"github.com/sirupsen/logrus/hooks/test"
+ "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly/v15/internal/git"
"gitlab.com/gitlab-org/gitaly/v15/internal/git/gittest"
@@ -149,8 +151,18 @@ func testServerPackObjectsHookSeparateContextWithRuntimeDir(t *testing.T, ctx co
go func() {
defer wg.Done()
_, err := client1.PackObjectsHookWithSidechannel(ctx1, req)
- testhelper.RequireGrpcCode(t, err, codes.Canceled)
- require.NoError(t, wt1.Wait())
+
+ if runtime.GOOS == "darwin" {
+ assert.Contains(t, []codes.Code{codes.Canceled, codes.Internal}, status.Code(err))
+
+ if status.Code(err) == codes.Internal {
+ assert.Contains(t, err.Error(), "write: socket is not connected")
+ }
+ } else {
+ testhelper.AssertGrpcCode(t, err, codes.Canceled)
+ }
+
+ assert.NoError(t, wt1.Wait())
}()
// Call 2: this is a normal call with the same request as call 1
@@ -189,8 +201,8 @@ func testServerPackObjectsHookSeparateContextWithRuntimeDir(t *testing.T, ctx co
go func() {
defer wg.Done()
_, err := client2.PackObjectsHookWithSidechannel(ctx2, req)
- require.NoError(t, err)
- require.NoError(t, wt2.Wait())
+ assert.NoError(t, err)
+ assert.NoError(t, wt2.Wait())
}()
close(start1)