From 6031e7fd98aa5afb98d9da25c84c507ae86b54c2 Mon Sep 17 00:00:00 2001 From: andrussal Date: Tue, 16 Dec 2025 04:09:13 +0100 Subject: [PATCH] refactor(core): name settle and balancer intervals --- testing-framework/core/src/scenario/runtime/runner.rs | 6 ++++-- testing-framework/core/src/topology/config.rs | 9 ++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/testing-framework/core/src/scenario/runtime/runner.rs b/testing-framework/core/src/scenario/runtime/runner.rs index 27de8c7..b5771b5 100644 --- a/testing-framework/core/src/scenario/runtime/runner.rs +++ b/testing-framework/core/src/scenario/runtime/runner.rs @@ -16,6 +16,8 @@ type WorkloadOutcome = Result<(), DynError>; const COOLDOWN_BLOCK_INTERVAL_MULTIPLIER: f64 = 5.0; const MIN_NODE_CONTROL_COOLDOWN: Duration = Duration::from_secs(30); +const DEFAULT_BLOCK_FEED_SETTLE_WAIT: Duration = Duration::from_secs(1); +const MIN_BLOCK_FEED_SETTLE_WAIT: Duration = Duration::from_secs(2); /// Represents a fully prepared environment capable of executing a scenario. pub struct Runner { @@ -136,8 +138,8 @@ impl Runner { return; } - let mut wait = hint.unwrap_or_else(|| Duration::from_secs(1)); - wait = wait.max(Duration::from_secs(2)); + let mut wait = hint.unwrap_or(DEFAULT_BLOCK_FEED_SETTLE_WAIT); + wait = wait.max(MIN_BLOCK_FEED_SETTLE_WAIT); sleep(wait).await; } diff --git a/testing-framework/core/src/topology/config.rs b/testing-framework/core/src/topology/config.rs index af21a9a..e679a43 100644 --- a/testing-framework/core/src/topology/config.rs +++ b/testing-framework/core/src/topology/config.rs @@ -25,6 +25,9 @@ use crate::topology::{ utils::{create_kms_configs, resolve_ids, resolve_ports}, }; +const DEFAULT_DA_BALANCER_INTERVAL: Duration = Duration::from_secs(1); +const VALIDATOR_EXECUTOR_DA_BALANCER_INTERVAL: Duration = Duration::from_secs(5); + /// High-level topology settings used to generate node configs for a scenario. #[derive(Clone)] pub struct TopologyConfig { @@ -82,7 +85,7 @@ impl TopologyConfig { max_replication_failures: 0, malicious_threshold: 0, }, - balancer_interval: Duration::from_secs(1), + balancer_interval: DEFAULT_DA_BALANCER_INTERVAL, ..Default::default() }, network_params: NetworkParams::default(), @@ -112,7 +115,7 @@ impl TopologyConfig { let min_peers = dispersal.saturating_sub(1).max(1); da_params.policy_settings.min_dispersal_peers = min_peers; da_params.policy_settings.min_replication_peers = min_peers; - da_params.balancer_interval = Duration::from_secs(1); + da_params.balancer_interval = DEFAULT_DA_BALANCER_INTERVAL; } Self { @@ -148,7 +151,7 @@ impl TopologyConfig { max_replication_failures: 0, malicious_threshold: 0, }, - balancer_interval: Duration::from_secs(5), + balancer_interval: VALIDATOR_EXECUTOR_DA_BALANCER_INTERVAL, ..Default::default() }, network_params: NetworkParams::default(),