Skip to content

Commit

Permalink
Merge #1671
Browse files Browse the repository at this point in the history
1671: test: disconnect check by all part r=u2,keroro520,quake a=driftluo

Disconnect check by all part

Co-authored-by: driftluo <driftluo@foxmail.com>
  • Loading branch information
bors[bot] and driftluo authored Oct 10, 2019
2 parents 854c32e + 1498d48 commit d990596
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 d990596

Please sign in to comment.