diff options
author | Paul Okstad <pokstad@gitlab.com> | 2020-11-12 21:51:08 +0300 |
---|---|---|
committer | Paul Okstad <pokstad@gitlab.com> | 2020-11-12 21:51:08 +0300 |
commit | 0fef3c2561ee0eced702b6552c76d8df2d78bb4e (patch) | |
tree | 9d9a397485d3806da3646d08b177b0087a6b6e6b | |
parent | a7be8f459b7bdf6c4ced855f071d7864361a3621 (diff) | |
parent | 82c2506640ef26887ea7b60f1a45839ba23fcf50 (diff) |
Merge branch 'pks-fix-test-modifying-gitaly-ref' into 'master'
git: Fix racy test creating refs in Gitaly repo
See merge request gitlab-org/gitaly!2781
-rw-r--r-- | internal/git/hooks_test.go | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/internal/git/hooks_test.go b/internal/git/hooks_test.go index edde977af..983a00f9f 100644 --- a/internal/git/hooks_test.go +++ b/internal/git/hooks_test.go @@ -24,7 +24,7 @@ func TestWithRefHook(t *testing.T) { config.Config.Auth.Token = token opt := git.WithRefTxHook(ctx, testRepo, config.Config) - subCmd := git.SubCmd{Name: "update-ref", Args: []string{"master", "0000"}} + subCmd := git.SubCmd{Name: "update-ref", Args: []string{"refs/heads/master", git.NullSHA}} for _, tt := range []struct { name string @@ -43,12 +43,6 @@ func TestWithRefHook(t *testing.T) { }, }, { - name: "SafeBareCmd", - fn: func() (*command.Command, error) { - return git.SafeBareCmd(ctx, git.CmdStream{}, nil, nil, subCmd, opt) - }, - }, - { name: "SafeStdinCmd", fn: func() (*command.Command, error) { return git.SafeStdinCmd(ctx, testRepo, nil, subCmd, opt) @@ -65,6 +59,7 @@ func TestWithRefHook(t *testing.T) { cmd, err := tt.fn() require.NoError(t, err) + require.NoError(t, cmd.Wait()) var actualEnvVars []string for _, env := range cmd.Env() { |