Skip to content

Commit

Permalink
Merge pull request #4565 from eval-exec/exec/fix-ci
Browse files Browse the repository at this point in the history
Integration Test: SyncInvalid should wait node1 ban node0
  • Loading branch information
quake authored Aug 5, 2024
2 parents 4e9e086 + 1ef2b50 commit 7c2eaee
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions test/src/specs/sync/sync_invalid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,25 @@ impl Spec for SyncInvalid {
)
.hash();

assert!(!nodes[1].rpc_client().get_banned_addresses().is_empty());
assert!(nodes[1]
.rpc_client()
.get_banned_addresses()
.first()
.unwrap()
.ban_reason
.contains(&format!("{}", block_21_hash)));
{
let now = std::time::Instant::now();
while nodes[1].rpc_client().get_banned_addresses().is_empty()
|| !nodes[1]
.rpc_client()
.get_banned_addresses()
.first()
.unwrap()
.ban_reason
.contains(&format!("{}", block_21_hash))
{
if now.elapsed() > Duration::from_secs(60) {
panic!("node[1] should ban node[0] in 60s");
}
info!("waiting for node[1] to ban node[0]");
sleep(Duration::from_secs(1));
}
}

info_nodes_tip();

nodes[0].stop();
Expand Down

0 comments on commit 7c2eaee

Please sign in to comment.