From 021b18335ca5f28df1029b2dc33ff027be0e8836 Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Tue, 14 Jan 2025 17:52:17 +0100 Subject: [PATCH] cmake/Tests: Default to half the cores Saturating all cores easily leads to timeouts. The system might be doing something else, and it only leaves at most one core per-test. E.g. this will cause 90% of runs to fail on a raspberry pi 4. Note that we set CTEST_PARALLEL_LEVEL on our CI machines anyway, so this will not affect them. --- cmake/Tests.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/Tests.cmake b/cmake/Tests.cmake index b085c2ba7..56d150417 100644 --- a/cmake/Tests.cmake +++ b/cmake/Tests.cmake @@ -8,7 +8,8 @@ if(NOT CTEST_PARALLEL_LEVEL) if(NOT CTEST_PARALLEL_LEVEL) include(ProcessorCount) ProcessorCount(CORES) - set(CTEST_PARALLEL_LEVEL ${CORES}) + math(EXPR halfcores "${CORES} / 2") + set(CTEST_PARALLEL_LEVEL ${halfcores}) endif() endif()