fix(raft): 新增 NewRaftWithDataDir, 修复 raft_test.go 编译#39
Merged
Conversation
raft_test.go 在 14 处调用 NewRaftWithDataDir(peers, me, dataDir) 用以隔离测试数据目录, 但函数从未定义, 导致整个 Raft 包测试无法编译。 NewRaft 保留原签名, 直接转调 NewRaftWithDataDir(..., "raft_data") 保持现有行为。 清掉残留 raft_data/raft_test_data_* 后, raft_test.go 全部 14 个用例本地通过。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesWAL Directory Configuration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Raft/raft.go新增NewRaftWithDataDir(peers, me, dataDir), 让测试能注入隔离的数据目录NewRaft(peers, me)内部转调NewRaftWithDataDir(..., \"raft_data\")保持线上行为raft_test.go中 14 处调用现在能正常编译Background
raft_test.go一直在调一个不存在的NewRaftWithDataDir函数, 整个 Raft 包测试无法编译。CI 当前只跑go vet/go build没碰测试, 所以一直漏。Test plan
已知遗留(不在本 PR 内修)
🤖 Generated with Claude Code
Summary by CodeRabbit