diff options
Diffstat (limited to 'internal/gitaly/service')
-rw-r--r-- | internal/gitaly/service/hook/pack_objects_test.go | 20 |
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) |