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>2022-07-13 10:06:56 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2022-07-13 10:06:56 +0300
commit7e0dccaed3f2ee60d0b03c0e2382c912ea59c729 (patch)
tree14e495827d895a756582d7d9f8785cb98d05bb00
parent65256b2f6fde703a1156e49be1f4ba9021d1c403 (diff)
parent53944694cec4277da2a4354af4f1d197edeef8d4 (diff)
Merge branch 'pks-updateref-skip-flaky-test-with-git-v2.33.0' into 'master'
updateref: Skip known-flaky test with Git v2.33.0 See merge request gitlab-org/gitaly!4699
-rw-r--r--internal/git/updateref/updateref_test.go26
1 files changed, 10 insertions, 16 deletions
diff --git a/internal/git/updateref/updateref_test.go b/internal/git/updateref/updateref_test.go
index 692493d27..743e215a8 100644
--- a/internal/git/updateref/updateref_test.go
+++ b/internal/git/updateref/updateref_test.go
@@ -122,9 +122,14 @@ func TestUpdater_prepareLocksTransaction(t *testing.T) {
func TestUpdater_concurrentLocking(t *testing.T) {
t.Parallel()
- ctx := testhelper.Context(t)
cfg, protoRepo, _ := testcfg.BuildWithRepo(t)
+ ctx := testhelper.Context(t)
+
+ if !gitSupportsStatusFlushing(t, ctx, cfg) {
+ t.Skip("git does not support flushing yet, which is known to be flaky")
+ }
+
repo := localrepo.NewTestRepo(t, cfg, protoRepo, git.WithSkipHooks())
commit, logErr := repo.ReadCommit(ctx, "refs/heads/master")
@@ -139,22 +144,11 @@ func TestUpdater_concurrentLocking(t *testing.T) {
require.NoError(t, err)
require.NoError(t, secondUpdater.Update("refs/heads/master", "", commit.Id))
- // With flushing, we're able to detect concurrent locking at prepare time already instead of
- // at commit time.
- if gitSupportsStatusFlushing(t, ctx, cfg) {
- err := secondUpdater.Prepare()
- require.Error(t, err)
- require.Contains(t, err.Error(), "fatal: prepare: cannot lock ref 'refs/heads/master'")
-
- require.NoError(t, firstUpdater.Commit())
- } else {
- require.NoError(t, secondUpdater.Prepare())
- require.NoError(t, firstUpdater.Commit())
+ err = secondUpdater.Prepare()
+ require.Error(t, err)
+ require.Contains(t, err.Error(), "fatal: prepare: cannot lock ref 'refs/heads/master'")
- err := secondUpdater.Commit()
- require.Error(t, err)
- require.Contains(t, err.Error(), "fatal: prepare: cannot lock ref 'refs/heads/master'")
- }
+ require.NoError(t, firstUpdater.Commit())
}
func TestBulkOperation(t *testing.T) {