Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

approval-voting: Make tests deterministic #3899

Merged
merged 5 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ TestConfiguration:
peer_bandwidth: 524288000000
bandwidth: 524288000000
num_blocks: 10
connectivity: 100
latency: null
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ TestConfiguration:
peer_bandwidth: 524288000000
bandwidth: 524288000000
num_blocks: 10
connectivity: 100
latency: null
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ TestConfiguration:
peer_bandwidth: 524288000000
bandwidth: 524288000000
num_blocks: 10
connectivity: 100
latency: null

Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ TestConfiguration:
peer_bandwidth: 524288000000
bandwidth: 524288000000
num_blocks: 10
connectivity: 100
latency: null

17 changes: 9 additions & 8 deletions polkadot/node/subsystem-bench/src/lib/approval/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -698,12 +698,12 @@ impl PeerMessageProducer {
.expect("We can't handle unknown peers")
.clone();

self.network
.send_message_from_peer(
&peer_authority_id,
protocol_v3::ValidationProtocol::ApprovalDistribution(message.msg).into(),
)
.unwrap_or_else(|_| panic!("Network should be up and running {:?}", sent_by));
if let Err(err) = self.network.send_message_from_peer(
&peer_authority_id,
protocol_v3::ValidationProtocol::ApprovalDistribution(message.msg).into(),
) {
gum::warn!(target: LOG_TARGET, ?sent_by, ?err, "Validator can not send message");
}
}

// Queues a message to be sent by the peer identified by the `sent_by` value.
Expand Down Expand Up @@ -994,11 +994,12 @@ pub async fn bench_approvals_run(
"polkadot_parachain_subsystem_bounded_received",
Some(("subsystem_name", "approval-distribution-subsystem")),
|value| {
gum::info!(target: LOG_TARGET, ?value, ?at_least_messages, "Waiting metric");
gum::debug!(target: LOG_TARGET, ?value, ?at_least_messages, "Waiting metric");
value >= at_least_messages as f64
},
)
.await;

gum::info!("Requesting approval votes ms");

for info in &state.blocks {
Expand Down Expand Up @@ -1038,7 +1039,7 @@ pub async fn bench_approvals_run(
"polkadot_parachain_subsystem_bounded_received",
Some(("subsystem_name", "approval-distribution-subsystem")),
|value| {
gum::info!(target: LOG_TARGET, ?value, ?at_least_messages, "Waiting metric");
gum::debug!(target: LOG_TARGET, ?value, ?at_least_messages, "Waiting metric");
value >= at_least_messages as f64
},
)
Expand Down
Loading