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.
This commit is contained in:
Daan De Meyer
2025-01-09 09:15:18 +01:00
parent 5ae3172867
commit b8582198ca
+8 -1
View File
@@ -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