summaryrefslogtreecommitdiff
path: root/cli/tools/test_runner.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tools/test_runner.rs')
-rw-r--r--cli/tools/test_runner.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/cli/tools/test_runner.rs b/cli/tools/test_runner.rs
index 968378fdc..d2612e59d 100644
--- a/cli/tools/test_runner.rs
+++ b/cli/tools/test_runner.rs
@@ -26,6 +26,7 @@ use rand::seq::SliceRandom;
use rand::SeedableRng;
use regex::Regex;
use serde::Deserialize;
+use std::num::NonZeroUsize;
use std::path::PathBuf;
use std::sync::mpsc::channel;
use std::sync::mpsc::Sender;
@@ -473,7 +474,7 @@ pub async fn run_tests(
allow_none: bool,
filter: Option<String>,
shuffle: Option<u64>,
- concurrent_jobs: usize,
+ concurrent_jobs: NonZeroUsize,
) -> Result<(), AnyError> {
if !allow_none && doc_modules.is_empty() && test_modules.is_empty() {
return Err(generic_error("No test modules found"));
@@ -572,10 +573,10 @@ pub async fn run_tests(
});
let join_stream = stream::iter(join_handles)
- .buffer_unordered(concurrent_jobs)
+ .buffer_unordered(concurrent_jobs.get())
.collect::<Vec<Result<Result<(), AnyError>, tokio::task::JoinError>>>();
- let mut reporter = create_reporter(concurrent_jobs > 1);
+ let mut reporter = create_reporter(concurrent_jobs.get() > 1);
let handler = {
tokio::task::spawn_blocking(move || {
let earlier = Instant::now();