Skip to content

Commit 4e78311

Browse files
authored
test(fixtures): adjust git monorepo creation fixtures to prevent race conditions (python-semantic-release#1491)
1 parent 1d56d3a commit 4e78311

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎tests/fixtures/monorepos/git_monorepo.py‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ def cached_example_git_monorepo(
8484

8585
def _build_repo(cached_repo_path: Path) -> Sequence[RepoActions]:
8686
if not cached_example_monorepo.exists():
87-
raise RuntimeError("Unable to find cached monorepo files")
87+
msg = "Unable to find cached monorepo files"
88+
raise RuntimeError(msg)
8889

8990
# make a copy of the example monorepo as a base
9091
copy_dir_tree(cached_example_monorepo, cached_repo_path)
@@ -109,6 +110,11 @@ def _build_repo(cached_repo_path: Path) -> Sequence[RepoActions]:
109110
config.set_value("commit", "gpgsign", False)
110111
config.set_value("tag", "gpgsign", False)
111112

113+
# Disable automatic garbage collection and background maintenance to prevent race conditions
114+
config.set_value("gc", "auto", 0)
115+
config.set_value("gc", "autoDetach", "false")
116+
config.set_value("maintenance", "auto", "false")
117+
112118
# set up a remote tracking branch for the default branch
113119
config.set_value(f'branch "{DEFAULT_BRANCH_NAME}"', "remote", "origin")
114120
config.set_value(

0 commit comments

Comments
 (0)