fix(test): 测试裸仓关 receive.autogc,消除 JGit 后台 gc 与 @TempDir 清理赛跑(dev-board#500) - #757
Merged
Conversation
…rd#500) CI run 34168686921 的 MemoryLwwMergeTest 间歇报 Failed to delete temp directory ... hub.git/gc.log.lock。根因:往 file:// 裸仓 push 时 JGit 在 进程内跑 ReceivePack,收尾按远端配置 receive.autogc(默认 true)触发 auto gc,auto gc 默认 autoDetach 在后台线程跑;gc.log.lock 在调用线程 同步建、后台线程异步删,与 JUnit 递归删 @tempdir 赛跑。 新增 com.checkba.version.BareHub.init(dir) 统一建测试裸仓并写入 receive.autogc=false,五处 Git.init().setBare(true) 全部收拢。 探针:autogc 开着 push 后 gc.log.lock 残留 99/100,关掉 0/100; MemoryLwwMergeTest+MemorySyncRoundTripTest 循环 20 轮 0 失败。 version-control.md 地雷 #49 记录。 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
GitHub Actions run 34168686921 的 Backend (mvn test) 间歇性报错:
根因
往 file:// 裸仓 push 时 JGit 6.9 在本进程内跑
ReceivePack,收尾按远端仓库配置receive.autogc(默认 true)调Repository.autoGC;auto gc 又按gc.autoDetach(默认 true)丢到后台线程。gc.log.lock在调用线程上同步创建、在后台线程上异步删除,仓库再小也一样。测试方法一返回 JUnit 就递归删@TempDir,撞上那几毫秒就红。修法
JGit 没暴露可等的后台句柄,所以选关开关:新增
com.checkba.version.BareHub.init(dir)统一建测试裸仓并写入receive.autogc=false,把五处Git.init().setBare(true)全部收拢(MemoryLwwMergeTest/MemorySyncRoundTripTest/CloudSyncUploadTest/CloudSyncUpdateTest/ProjectRepoRemoteTest,后三个是同一病灶的潜伏点)。生产侧不受影响。验证
gc.log.lock残留 99/100 次,关掉后 0/100。mvn -o -Dtest='MemoryLwwMergeTest,MemorySyncRoundTripTest' test循环 20 轮,20/20 通过。CloudSyncUploadTest(8)/CloudSyncUpdateTest(14)/ProjectRepoRemoteTest(4) 全绿。.claude/agents/version-control.md地雷 feat(libreoffice): webview-side editor endpoint, composed + verified (dormant) / webview 侧编辑器端点(组装+已验证,休眠) #49 记录。Closes zeweihan/dev-board#500
🤖 Generated with Claude Code