diff --git a/backend/telemetry_core/tests/e2e_tests.rs b/backend/telemetry_core/tests/e2e_tests.rs index 4ce7150..e0beceb 100644 --- a/backend/telemetry_core/tests/e2e_tests.rs +++ b/backend/telemetry_core/tests/e2e_tests.rs @@ -518,6 +518,9 @@ async fn slow_feeds_are_disconnected() { // Allow us to send more messages in more easily: ShardOpts { max_nodes_per_connection: Some(100_000), + // Prevent the shard being being banned when it sends a load of data at once: + max_node_data_per_second: Some(100_000_000), + ..Default::default() }, ) .await; @@ -604,6 +607,7 @@ async fn max_nodes_per_connection_is_enforced() { // Limit max nodes per connection to 2; any other msgs should be ignored. ShardOpts { max_nodes_per_connection: Some(2), + ..Default::default() }, ) .await; diff --git a/backend/test_utils/src/workspace/start_server.rs b/backend/test_utils/src/workspace/start_server.rs index 72f6550..1323fb0 100644 --- a/backend/test_utils/src/workspace/start_server.rs +++ b/backend/test_utils/src/workspace/start_server.rs @@ -31,12 +31,16 @@ impl Default for CoreOpts { /// Additional options to pass to the shard command. pub struct ShardOpts { pub max_nodes_per_connection: Option, + pub max_node_data_per_second: Option, + pub node_block_seconds: Option, } impl Default for ShardOpts { fn default() -> Self { Self { max_nodes_per_connection: None, + max_node_data_per_second: None, + node_block_seconds: None } } } @@ -95,10 +99,20 @@ pub async fn start_server( }); // Append additional opts to the shard command - if let Some(max_nodes_per_connection) = shard_opts.max_nodes_per_connection { + if let Some(val) = shard_opts.max_nodes_per_connection { shard_command = shard_command .arg("--max-nodes-per-connection") - .arg(max_nodes_per_connection.to_string()); + .arg(val.to_string()); + } + if let Some(val) = shard_opts.max_node_data_per_second { + shard_command = shard_command + .arg("--max-node-data-per-second") + .arg(val.to_string()); + } + if let Some(val) = shard_opts.node_block_seconds { + shard_command = shard_command + .arg("--node-block-seconds") + .arg(val.to_string()); } // Build the core command @@ -110,10 +124,10 @@ pub async fn start_server( }); // Append additional opts to the core command - if let Some(feed_timeout) = core_opts.feed_timeout { + if let Some(val) = core_opts.feed_timeout { core_command = core_command .arg("--feed-timeout") - .arg(feed_timeout.to_string()); + .arg(val.to_string()); } // Star the server