mirror of
https://github.com/pezkuwichain/revive-differential-tests.git
synced 2026-06-13 17:31:02 +00:00
Change the default concurrency limit
This commit is contained in:
+10
-14
@@ -931,25 +931,21 @@ pub struct ConcurrencyConfiguration {
|
|||||||
)]
|
)]
|
||||||
pub number_of_threads: usize,
|
pub number_of_threads: usize,
|
||||||
|
|
||||||
/// Determines the amount of concurrent tasks that will be spawned to run tests.
|
/// Determines the amount of concurrent tasks that will be spawned to run tests. This means that
|
||||||
|
/// at any given time there is `concurrency.number-of-concurrent-tasks` tests concurrently
|
||||||
|
/// executing.
|
||||||
///
|
///
|
||||||
/// Defaults to 10 x the number of nodes.
|
/// Note that a task limit of `0` means no limit on the number of concurrent tasks.
|
||||||
#[arg(long = "concurrency.number-of-concurrent-tasks")]
|
#[arg(long = "concurrency.number-of-concurrent-tasks", default_value_t = 500)]
|
||||||
number_concurrent_tasks: Option<usize>,
|
number_concurrent_tasks: usize,
|
||||||
|
|
||||||
/// Determines if the concurrency limit should be ignored or not.
|
|
||||||
#[arg(long = "concurrency.ignore-concurrency-limit")]
|
|
||||||
ignore_concurrency_limit: bool,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ConcurrencyConfiguration {
|
impl ConcurrencyConfiguration {
|
||||||
pub fn concurrency_limit(&self) -> Option<usize> {
|
pub fn concurrency_limit(&self) -> Option<usize> {
|
||||||
match self.ignore_concurrency_limit {
|
if self.number_concurrent_tasks == 0 {
|
||||||
true => None,
|
None
|
||||||
false => Some(
|
} else {
|
||||||
self.number_concurrent_tasks
|
Some(self.number_concurrent_tasks)
|
||||||
.unwrap_or(20 * self.number_of_nodes),
|
|
||||||
),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user