From cef39b2940c92d2a53dc8c9e8bb184d31a60bda1 Mon Sep 17 00:00:00 2001 From: oliverpool Date: Tue, 2 Apr 2024 09:00:33 +0200 Subject: [PATCH] [TESTS] fix flack git check-attr flacky subtest --- modules/git/repo_attribute_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/git/repo_attribute_test.go b/modules/git/repo_attribute_test.go index ef02f2de7..9b7b43d51 100644 --- a/modules/git/repo_attribute_test.go +++ b/modules/git/repo_attribute_test.go @@ -229,7 +229,12 @@ func TestGitAttributeCheckerError(t *testing.T) { assert.NoError(t, os.RemoveAll(gitRepo.Path)) _, err = ac.CheckPath("i-am-a-python.p") - assert.Error(t, err) + if err == nil { + t.Skip( + "git check-attr started too fast and CheckPath was succesful (and likely cached)", + "https://codeberg.org/forgejo/forgejo/issues/2948", + ) + } // Depending on the order of execution, the returned error can be: // - a launch error "fork/exec /usr/bin/git: no such file or directory" (when the removal happens before the Run) // - a git error (stderr: "fatal: Unable to read current working directory: No such file or directory"): exit status 128 (when the removal happens after the Run)