talent-plan/tinykv

testNonleaderElectionTimeoutRandomized 单测疑问

Opened this issue · 2 comments

企业微信截图_16438115908094

当节点 r.becomeCandidate() 应该立即发送 vote 请求吧,这时候 len(r.readMessages()) == 0 因该永远不成立吧,那么 第 306 行的单测应该永远不能通过吧? 谢谢

The test assumes that becomeCandidate won't send VoteRequest message immediately. Instead, when r.tick() trigger new election then implementation should call becomeCandidate and sending VoteRequest message.