Skip to content

Commit

Permalink
Merge pull request #1926 from input-output-hk/jts_trust_fix
Browse files Browse the repository at this point in the history
[Tests] Private network multiple trust fix
  • Loading branch information
dkijania authored Mar 18, 2020
2 parents aa97452 + d80671d commit 9324c36
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,11 @@ pub fn mesh(mut context: Context<ChaChaRng>) -> Result<ScenarioResult> {
"T3004_Mesh",
&mut context,
topology [
LEADER_1 -> LEADER_4,LEADER_5,
LEADER_2 -> LEADER_1,LEADER_3,
LEADER_3 -> LEADER_1,LEADER_4,
LEADER_1 -> LEADER_4 -> LEADER_5,
LEADER_2 -> LEADER_1 -> LEADER_3,
LEADER_3 -> LEADER_1 -> LEADER_4,
LEADER_4 -> LEADER_5,
LEADER_5 -> LEADER_3,LEADER_1,
LEADER_5 -> LEADER_3 -> LEADER_1,
]
blockchain {
consensus = GenesisPraos,
Expand Down
10 changes: 5 additions & 5 deletions jormungandr-scenario-tests/src/test/non_functional/disruption.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ pub fn custom_network_disruption(mut context: Context<ChaChaRng>) -> Result<Scen
topology [
LEADER_5,
LEADER_1 -> LEADER_3,
LEADER_2 -> LEADER_3,LEADER_5,
LEADER_2 -> LEADER_3 -> LEADER_5,
LEADER_3 -> LEADER_5,
LEADER_4 -> LEADER_5,
PASSIVE -> LEADER_5,
Expand Down Expand Up @@ -618,10 +618,10 @@ pub fn mesh_disruption(mut context: Context<ChaChaRng>) -> Result<ScenarioResult
&mut context,
topology [
LEADER_4,
LEADER_1 -> LEADER_4,LEADER_5,
LEADER_2 -> LEADER_1,LEADER_3,
LEADER_3 -> LEADER_1,LEADER_4,
LEADER_5 -> LEADER_3,LEADER_1,
LEADER_1 -> LEADER_4 -> LEADER_5,
LEADER_2 -> LEADER_1 -> LEADER_3,
LEADER_3 -> LEADER_1 -> LEADER_4,
LEADER_5 -> LEADER_3 -> LEADER_1,
]
blockchain {
consensus = GenesisPraos,
Expand Down
25 changes: 17 additions & 8 deletions jormungandr-scenario-tests/src/test/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,29 @@ pub fn measure_and_log_sync_time(
.with_thresholds(sync_wait)
.start();

let mut report_node_stats_counter = 0;
let report_node_stats_interval = 20;

while !benchmark.timeout_exceeded() {
let block_heights: Vec<u32> = nodes
.iter()
.map(|node| {
node.stats()
.unwrap()
.stats
.unwrap()
.last_block_height
.unwrap()
.parse()
.unwrap()
let stats = node.stats().unwrap().stats.unwrap();

if report_node_stats_counter >= report_node_stats_interval {
println!("Node: {} -> {:?}", node.alias(), stats);
}

stats.last_block_height.unwrap().parse().unwrap()
})
.collect();

if report_node_stats_counter >= report_node_stats_interval {
report_node_stats_counter = 0;
} else {
report_node_stats_counter = report_node_stats_counter + 1;
}

println!(
"Measuring sync time... current block heights: {:?}",
block_heights
Expand Down

0 comments on commit 9324c36

Please sign in to comment.