From 5b63ed281661a999e7aa3ca02189fac28bd07489 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Wed, 9 Feb 2022 06:38:16 -0600 Subject: [PATCH] Testsuite: do not use 0 for task limit --- tests/tests.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/tests.h b/tests/tests.h index f12d9e1542..123e7b7b66 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -427,17 +427,20 @@ filter_out_small_numbers(const Number number, const double tolerance) inline unsigned int testing_max_num_threads() { + const int default_n_threads = 3; + if (const char *penv = std::getenv("TEST_N_THREADS")) try { - return Utilities::string_to_int(std::string(penv)); + const int n_threads = Utilities::string_to_int(std::string(penv)); + return n_threads > 0 ? n_threads : default_n_threads; } catch (...) { - return 3; + return default_n_threads; } else - return 3; + return default_n_threads; } struct LimitConcurrency -- 2.39.5