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.
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user