Skip to content

Commit baf4929

Browse files
authored
1 parent 50841ef commit baf4929

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

core/parameters/src/config.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,14 @@ impl BandwidthSchedulerConfig {
286286
/// Creates a config that effectively disables BandwidthScheduler related limits by setting them
287287
/// to max values. This can be useful for tests and benchmarks.
288288
pub fn test_disabled() -> Self {
289+
// Using `u64::MAX` would lead to overflows as these numbers are used in additions and
290+
// multiplications. The values below are still high enough to effectively disable limits.
291+
let one_tb = 1_000_000_000_000;
289292
Self {
290-
max_shard_bandwidth: u64::MAX,
291-
max_single_grant: u64::MAX,
292-
max_allowance: u64::MAX,
293-
max_base_bandwidth: u64::MAX,
293+
max_shard_bandwidth: 100 * one_tb,
294+
max_single_grant: one_tb,
295+
max_allowance: one_tb,
296+
max_base_bandwidth: one_tb,
294297
}
295298
}
296299
}

0 commit comments

Comments
 (0)