diff options
author | Pavlo Strokov <pstrokov@gitlab.com> | 2021-11-04 17:00:31 +0300 |
---|---|---|
committer | Pavlo Strokov <pstrokov@gitlab.com> | 2021-11-04 17:00:31 +0300 |
commit | 022905caea5e281cc2e096407212ee3daaddedb9 (patch) | |
tree | 89b5c4aa2aa66517e4a9aa33390bbeca37749a9e | |
parent | c959b634bd98035355259ffcd421d7a43e015982 (diff) | |
parent | a073666ab6498039fd54099dd55c42db2ca5f605 (diff) |
Merge branch 'pks-gitaly-git2go-etxtbsy' into 'master'
testcfg: Try to fix ETXTBSY errors with gitaly-git2go executable
Closes #3869
See merge request gitlab-org/gitaly!4041
-rw-r--r-- | internal/testhelper/testcfg/build.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/internal/testhelper/testcfg/build.go b/internal/testhelper/testcfg/build.go index b56197d73..c5d631a73 100644 --- a/internal/testhelper/testcfg/build.go +++ b/internal/testhelper/testcfg/build.go @@ -93,8 +93,13 @@ func BuildBinary(t testing.TB, targetDir, sourcePath string) string { require.NoFileExists(t, targetPath, "%s exists already -- do you try to build it twice?", executableName) require.NoError(t, os.MkdirAll(targetDir, os.ModePerm)) - testhelper.CopyFile(t, sharedBinaryPath, targetPath) - require.NoError(t, os.Chmod(targetPath, 0o755)) + + // We hard-link the file into place instead of copying it because copying used to cause + // ETXTBSY errors in CI. This is likely caused by a bug in the overlay filesystem used by + // Docker, so we just work around this by linking the file instead. It's more efficient + // anyway, the only thing is that no test must modify the binary directly. But let's count + // on that. + require.NoError(t, os.Link(sharedBinaryPath, targetPath)) return targetPath } |