From b8582198ca1e6fe390f7169e623a9130b68a6b36 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Wed, 8 Jan 2025 22:20:42 +0100 Subject: [PATCH] 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. --- test/fmf/integration-tests/test.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 -- 2.47.3