diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2025-01-08 22:20:42 +0100 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2025-01-09 09:15:18 +0100 |
commit | b8582198ca1e6fe390f7169e623a9130b68a6b36 (patch) | |
tree | c63d49a41d7ca7e719aa492025307508800f91d8 /test/fmf | |
parent | hwids: add a new efi firmware type of device entry (#35747) (diff) | |
download | systemd-b8582198ca1e6fe390f7169e623a9130b68a6b36.tar.xz systemd-b8582198ca1e6fe390f7169e623a9130b68a6b36.zip |
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.
Diffstat (limited to 'test/fmf')
-rwxr-xr-x | test/fmf/integration-tests/test.sh | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/fmf/integration-tests/test.sh b/test/fmf/integration-tests/test.sh index 4545090c3c..effe4b2d6f 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 |