Skip to content

Commit

Permalink
squash commits
Browse files Browse the repository at this point in the history
Signed-off-by: Fullstop000 <[email protected]>
  • Loading branch information
Fullstop000 committed Feb 25, 2020
1 parent afabefa commit 1da637c
Show file tree
Hide file tree
Showing 14 changed files with 1,219 additions and 100 deletions.
8 changes: 8 additions & 0 deletions harness/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,21 @@ impl Network {
/// Read out all messages generated by peers in the `Network`.
///
/// Note: messages are not filtered by any configured filters.
#[inline]
pub fn read_messages(&mut self) -> Vec<Message> {
self.peers
.iter_mut()
.flat_map(|(_peer, progress)| progress.read_messages())
.collect()
}

#[inline]
pub fn read_peer_messages(&mut self, id: u64) -> Vec<Message> {
self.peers
.get_mut(&id)
.map_or(vec![], |node| node.read_messages())
}

/// Instruct the cluster to `step` through the given messages.
///
/// NOTE: the given `msgs` won't be filtered by its filters.
Expand Down
1 change: 1 addition & 0 deletions harness/tests/integration_cases/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

mod test_raft;
mod test_raft_flow_control;
mod test_raft_follower_replication;
mod test_raft_paper;
mod test_raft_snap;
mod test_raw_node;
2 changes: 1 addition & 1 deletion harness/tests/integration_cases/test_raft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1196,7 +1196,7 @@ fn test_handle_msg_append() {
);

sm.become_follower(2, INVALID_ID);
sm.handle_append_entries(&m);
sm.handle_append_message(m);
if sm.raft_log.last_index() != w_index {
panic!(
"#{}: last_index = {}, want {}",
Expand Down
Loading

0 comments on commit 1da637c

Please sign in to comment.