-
Notifications
You must be signed in to change notification settings - Fork 398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
raft: port disruptive test #41
Conversation
LGTM |
tests/cases/test_raft.rs
Outdated
@@ -2260,6 +2260,154 @@ fn test_non_promotable_voter_which_check_quorum() { | |||
assert_eq!(nt.peers[&2].leader_id, 1); | |||
} | |||
|
|||
#[test] | |||
// test_disruptive_follower tests isolated follower, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use doc comment and put the #[test]
attribute below the comments.
tests/cases/test_raft.rs
Outdated
nt.send(vec![new_message(1, 1, MessageType::MsgPropose, 1)]); | ||
nt.send(vec![new_message(1, 1, MessageType::MsgPropose, 1)]); | ||
|
||
nt.peers.get_mut(&1).unwrap().pre_vote = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be set when the node is created using new_test_raft_with_prevote
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest LGTM
src/raft.rs
Outdated
@@ -224,7 +224,7 @@ pub struct Raft<T: Storage> { | |||
heartbeat_elapsed: usize, | |||
|
|||
pub check_quorum: bool, | |||
pre_vote: bool, | |||
pub pre_vote: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems it doesn't have to be pub
now?
Thanks for your contributions! |
the port the raft relate part in etcd about #39