Skip to content

Commit

Permalink
fix another window service test
Browse files Browse the repository at this point in the history
  • Loading branch information
sagar-solana committed Feb 1, 2019
1 parent 8cc5a86 commit de38aad
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/window_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,15 +249,19 @@ mod test {
#[test]
pub fn window_send_test() {
solana_logger::setup();
let tn = Node::new_localhost();
// setup a leader whose id is used to generates blobs and a validator
// node whose window service will retransmit leader blobs.
let leader_node = Node::new_localhost();
let validator_node = Node::new_localhost();
let exit = Arc::new(AtomicBool::new(false));
let mut cluster_info_me = ClusterInfo::new(tn.info.clone());
let me_id = cluster_info_me.my_data().id;
let mut cluster_info_me = ClusterInfo::new(validator_node.info.clone());
let me_id = leader_node.info.id;
cluster_info_me.set_leader(me_id);
let subs = Arc::new(RwLock::new(cluster_info_me));

let (s_reader, r_reader) = channel();
let t_receiver = blob_receiver(Arc::new(tn.sockets.gossip), exit.clone(), s_reader);
let t_receiver =
blob_receiver(Arc::new(leader_node.sockets.gossip), exit.clone(), s_reader);
let (s_window, r_window) = channel();
let (s_retransmit, r_retransmit) = channel();
let done = Arc::new(AtomicBool::new(false));
Expand All @@ -274,19 +278,19 @@ mod test {
r_reader,
Some(s_window),
s_retransmit,
Arc::new(tn.sockets.repair),
Arc::new(leader_node.sockets.repair),
Arc::new(RwLock::new(LeaderScheduler::from_bootstrap_leader(me_id))),
done,
exit.clone(),
);
let t_responder = {
let (s_responder, r_responder) = channel();
let blob_sockets: Vec<Arc<UdpSocket>> =
tn.sockets.tvu.into_iter().map(Arc::new).collect();
leader_node.sockets.tvu.into_iter().map(Arc::new).collect();

let t_responder = responder("window_send_test", blob_sockets[0].clone(), r_responder);
let num_blobs_to_make = 10;
let gossip_address = &tn.info.gossip;
let gossip_address = &leader_node.info.gossip;
let msgs = make_consecutive_blobs(
&me_id,
num_blobs_to_make,
Expand Down

0 comments on commit de38aad

Please sign in to comment.