Skip to content

Commit

Permalink
test: disconncet check by all part
Browse files Browse the repository at this point in the history
  • Loading branch information
driftluo committed Oct 8, 2019
1 parent 2fc8ec5 commit 1498d48
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion test/src/specs/sync/ibd_process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,17 @@ impl Spec for IBDProcessWithWhiteList {
}

node6.disconnect(node0);

// Make sure both sides are disconnected
let is_disconnect_already = wait_until(10, || {
let peers = rpc_client0.get_peers();
peers.iter().any(|peer| peer.node_id == node6.node_id())
});

if is_disconnect_already {
panic!("node6 can't disconnect with node0");
}

node6.generate_blocks(2);

let generate_res = wait_until(10, || net.nodes[6].get_tip_block_number() == 2);
Expand All @@ -147,7 +158,8 @@ impl Spec for IBDProcessWithWhiteList {
panic!("node6 can't generate blocks to 2");
}

node0.connect_uncheck(node6);
// Make sure node0 re-connect with node6
node0.connect(node6);

// IBD only with outbound/whitelist node
let rpc_client1 = node1.rpc_client();
Expand Down

0 comments on commit 1498d48

Please sign in to comment.