]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
fmf: Use different heuristic on beefy systems
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 10 Jan 2025 14:26:54 +0000 (15:26 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 10 Jan 2025 15:14:01 +0000 (16:14 +0100)
If we save journals in /tmp, we can run a larger number of tests in
parallel so let's make use of the larger number of CPUs if the tests
run on a beefy machine.

test/fmf/integration-tests/test.sh

index 34bf1abfa8943244b530037c387b680e9fd9f4db..06a98bfd7a0be188226da7aff745f124736a5f49 100755 (executable)
@@ -116,6 +116,14 @@ if [[ ! -e /dev/kvm ]]; then
     export TEST_NO_QEMU=1
 fi
 
+NPROC="$(nproc)"
+if [[ "$NPROC" -ge 10 ]]; then
+    export TEST_JOURNAL_USE_TMP=1
+    NPROC="$((NPROC / 3))"
+else
+    NPROC="$((NPROC - 1))"
+fi
+
 # Create missing mountpoint for mkosi sandbox.
 mkdir -p /etc/pacman.d/gnupg
 
@@ -131,7 +139,7 @@ mkosi -f sandbox \
     --suite integration-tests \
     --print-errorlogs \
     --no-stdsplit \
-    --num-processes "$(($(nproc) - 1))" && EC=0 || EC=$?
+    --num-processes "$NPROC" && EC=0 || EC=$?
 
 find build/meson-logs -type f -exec mv {} "$TMT_TEST_DATA" \;
 find build/test/journal -type f -exec mv {} "$TMT_TEST_DATA" \;