From bbdd3f4505a866bebb07b73071b2837d5f6d87d0 Mon Sep 17 00:00:00 2001 From: weichen Date: Fri, 9 Oct 2026 17:10:18 +0000 Subject: [PATCH] Disable auto-gc in the task-lifecycle remote fixture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Why: git receive-pack runs 'gc --auto' in the background after a push; the fixture's TemporaryDirectory teardown then races the gc writer and fails with OSError 39 (remote.git not empty) — observed on the PR #285 runner (job 1967). The fixture remote holds no durable value, so auto-gc is pure flake surface. Evidence: the failing test passes 5/5 locally after the fix; full make test-governance green (104 tests). Impact: test fixture only; no governance-script behavior change. Refs: Dev CI run 1438 job 1967; same race family as the upload-host TempDir flake fixed earlier. --- tests/test_task.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_task.py b/tests/test_task.py index 9a0c09cb..b67dce19 100644 --- a/tests/test_task.py +++ b/tests/test_task.py @@ -29,6 +29,10 @@ class TaskLifecycleTests(unittest.TestCase): "TASK_PARENT_BRANCH", "TASK_PARENT_PR", "FORCE_ABANDON", "TASK_TARGET_BRANCH"): self.env.pop(key, None) self.git(self.root, "init", "--bare", "--initial-branch=main", str(self.remote)) + # receive-pack 默认在后台跑 gc --auto,与 TemporaryDirectory 清理竞态 + # (CI 实测 OSError 39 remote.git not empty);夹具远端无留存价值,直接关。 + self.git(self.remote, "config", "gc.auto", "0") + self.git(self.remote, "config", "receive.autogc", "false") self.git(self.root, "init", "--initial-branch=main", str(self.repo)) shutil.copytree(SOURCE / "scripts", self.repo / "scripts") (self.repo / "Makefile").write_text("precheck:\n\t@bash scripts/task.sh precheck\n")