Tests: no background git upkeep in test projects
The setup commit started a detached git gc that pruned the tripwires test's fake .git/worktrees folders later under load (7 of 16 runs failed with four loops at once; 0 of 40 after). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
6292f5c45e
commit
62e494de8e
1 file changed
+3
-1
+3
-1
@@ -75,7 +75,9 @@ class Core(unittest.TestCase):
|
||||
def project(self, name):
|
||||
path = os.path.join(self.tmp, name)
|
||||
os.makedirs(path)
|
||||
for args in (["init", "-q"], ["-c", "user.name=t", "-c", "user.email=t@t", "commit", "-q", "--allow-empty", "-m", "start"]):
|
||||
# no background upkeep: the commit starts a detached `git gc`, which prunes a test's fake .git/worktrees folders later, under load
|
||||
for args in (["init", "-q"], ["config", "gc.auto", "0"], ["config", "maintenance.auto", "false"],
|
||||
["-c", "user.name=t", "-c", "user.email=t@t", "commit", "-q", "--allow-empty", "-m", "start"]):
|
||||
subprocess.run(["git"] + args, cwd=path, check=True, capture_output=True)
|
||||
return path
|
||||
|
||||
|
||||
Reference in new issue
Block a user