From: Daan De Meyer Date: Wed, 8 Jan 2025 21:20:42 +0000 (+0100) Subject: fmf: Use different heuristic for number of process with many CPUs X-Git-Tag: v258-rc1~1659 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8582198ca1e6fe390f7169e623a9130b68a6b36;p=thirdparty%2Fsystemd.git fmf: Use different heuristic for number of process with many CPUs Downstream we sometimes end up with machines with lots of CPUs which leads to running out of memory when trying to run the tests in VMs. So let's switch to a different heuristic when we have lots of CPUs to avoid running out of memory. --- diff --git a/test/fmf/integration-tests/test.sh b/test/fmf/integration-tests/test.sh index 4545090c3c1..effe4b2d6f5 100755 --- a/test/fmf/integration-tests/test.sh +++ b/test/fmf/integration-tests/test.sh @@ -100,6 +100,13 @@ if [[ ! -e /dev/kvm ]]; then export TEST_NO_QEMU=1 fi +NPROC=$(nproc) +if [[ $NPROC -ge 10 ]]; then + NPROC=$((NPROC / 2)) +else + NPROC=$((NPROC - 1)) +fi + # Create missing mountpoint for mkosi sandbox. mkdir -p /etc/pacman.d/gnupg @@ -115,6 +122,6 @@ mkosi -f sandbox \ --suite integration-tests \ --print-errorlogs \ --no-stdsplit \ - --num-processes "$(($(nproc) - 1))" + --num-processes "$NPROC" popd