From cc2fcb52d6df68e546e37e7b0d23c936cb483ad3 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Tue, 21 Dec 2021 02:51:26 +0200 Subject: [PATCH] tests: fix the shown number of jobs for the test summary --- cmd/tools/modules/testing/common.v | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/tools/modules/testing/common.v b/cmd/tools/modules/testing/common.v index a08bcc30c6..405349a288 100644 --- a/cmd/tools/modules/testing/common.v +++ b/cmd/tools/modules/testing/common.v @@ -246,7 +246,11 @@ pub fn (mut ts TestSession) test() { remaining_files = vtest.filter_vtest_only(remaining_files, fix_slashes: false) ts.files = remaining_files ts.benchmark.set_total_expected_steps(remaining_files.len) - ts.benchmark.njobs = runtime.nr_jobs() + mut njobs := runtime.nr_jobs() + if remaining_files.len < njobs { + njobs = remaining_files.len + } + ts.benchmark.njobs = njobs mut pool_of_test_runners := pool.new_pool_processor(callback: worker_trunner) // for handling messages across threads ts.nmessages = chan LogMessage{cap: 10000}