systemd/0128-fmf-Use-different-heuristic-on-beefy-systems.patch
Jan Macku 1e3185a7aa systemd-257-5
Resolves: RHEL-71409
2025-02-03 14:56:43 +01:00

43 lines
1.4 KiB
Diff

From 562bb35dc778ce362d02d27d1554ab872caf486d Mon Sep 17 00:00:00 2001
From: Daan De Meyer <daan.j.demeyer@gmail.com>
Date: Fri, 10 Jan 2025 15:26:54 +0100
Subject: [PATCH] fmf: Use different heuristic on beefy systems
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.
(cherry picked from commit 53546c71fe0a1b30ee296df84bb8c3577f5675a4)
---
test/fmf/integration-tests/test.sh | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/test/fmf/integration-tests/test.sh b/test/fmf/integration-tests/test.sh
index 34bf1abfa8..06a98bfd7a 100755
--- a/test/fmf/integration-tests/test.sh
+++ b/test/fmf/integration-tests/test.sh
@@ -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" \;