Skip to content

Commit

Permalink
Keep only first part of stress test to be faster
Browse files Browse the repository at this point in the history
  • Loading branch information
sfauvel committed May 16, 2024
1 parent 68b93f4 commit 93d4619
Showing 1 changed file with 46 additions and 46 deletions.
92 changes: 46 additions & 46 deletions mithril-test-lab/mithril-end-to-end/src/bin/load-aggregator/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,52 +67,52 @@ async fn main() -> StdResult<()> {
let aggregator_endpoint = aggregator.endpoint();
reporter.stop();

let mut scenario_parameters = ScenarioParameters {
aggregator,
aggregator_parameters,
signers_fixture,
immutable_db,
reporter,
precomputed_mithril_stake_distribution_signatures: mithril_stake_distribution_signatures,
};

let scenario_counters = ScenarioCounters {
current_epoch,
number_of_certificates: 1,
number_of_mithril_stake_distributions: 0,
number_of_snapshots: 0,
};

info!(">> Run phase 1 without client load");
let scenario_counters = main_scenario(scenario_counters, &mut scenario_parameters).await?;

info!(">> Run phase 2 with client load");
let (shutdown_tx, mut shutdown_rx) = oneshot::channel();
let clients_handle = tokio::spawn(async move {
if opts.num_clients > 0 {
loop {
tokio::select! {
_msg = &mut shutdown_rx => {
break;
}
_ = clients_scenario(aggregator_endpoint.clone(), opts.num_clients) => {

}
}
}
}
});
main_scenario(scenario_counters, &mut scenario_parameters)
.await
.expect("the main scenario should not fail");
let _ = shutdown_tx.send(());
clients_handle.await.unwrap();

info!(">> Display execution timings:");
scenario_parameters.reporter.print_report();

info!(">> All steps executed successfully, stopping all tasks...");
scenario_parameters.aggregator.stop().await.unwrap();
// let mut scenario_parameters = ScenarioParameters {
// aggregator,
// aggregator_parameters,
// signers_fixture,
// immutable_db,
// reporter,
// precomputed_mithril_stake_distribution_signatures: mithril_stake_distribution_signatures,
// };

// let scenario_counters = ScenarioCounters {
// current_epoch,
// number_of_certificates: 1,
// number_of_mithril_stake_distributions: 0,
// number_of_snapshots: 0,
// };

// info!(">> Run phase 1 without client load");
// let scenario_counters = main_scenario(scenario_counters, &mut scenario_parameters).await?;

// info!(">> Run phase 2 with client load");
// let (shutdown_tx, mut shutdown_rx) = oneshot::channel();
// let clients_handle = tokio::spawn(async move {
// if opts.num_clients > 0 {
// loop {
// tokio::select! {
// _msg = &mut shutdown_rx => {
// break;
// }
// _ = clients_scenario(aggregator_endpoint.clone(), opts.num_clients) => {

// }
// }
// }
// }
// });
// main_scenario(scenario_counters, &mut scenario_parameters)
// .await
// .expect("the main scenario should not fail");
// let _ = shutdown_tx.send(());
// clients_handle.await.unwrap();

// info!(">> Display execution timings:");
// scenario_parameters.reporter.print_report();

// info!(">> All steps executed successfully, stopping all tasks...");
// scenario_parameters.aggregator.stop().await.unwrap();

Ok(())
}
Expand Down

0 comments on commit 93d4619

Please sign in to comment.