From 73d55d35b23c4ebef8b7084217e4c5b201f0eb73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Fri, 7 Feb 2025 14:53:53 +0100 Subject: [PATCH] Use up to 8 cores when testing to make it faster Allow changing it explicitly by CORES and MAXCORES variables. MAXCORES=0 disables upper limit. --- Sanity/named/Run-internal-BIND-test-suite/runtest.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Sanity/named/Run-internal-BIND-test-suite/runtest.sh b/Sanity/named/Run-internal-BIND-test-suite/runtest.sh index f434b64..54c6b2e 100755 --- a/Sanity/named/Run-internal-BIND-test-suite/runtest.sh +++ b/Sanity/named/Run-internal-BIND-test-suite/runtest.sh @@ -39,7 +39,10 @@ : ${PACKAGE:=bind} USER="user$RANDOM" -CORES=1 +: ${CORES:=auto} +# Limit maximal number of cores used at the same time. +# May cause more failures. +: ${MAXCORES:=8} : ${WITHOUT:=--without DOC --without EXPORT_LIBS} rlJournalStart @@ -80,8 +83,10 @@ rlJournalStart KNOWNERROR=`readlink -f knownerror` fi - if [ -z "$CORES" ]; then - rlRun "CORES=$(grep '^processor\s*:' /proc/cpuinfo | wc -l)" 0 "Count available CPU cores" + if [ -z "$CORES" ] || [ "$CORES" = "auto" ]; then + rlRun "CORES=$(lscpu -p | grep -v '^\s*#' | wc -l)" 0 "Get available CPU cores" + [[ CORES -lt 1 ]] && CORES=1 + [[ MAXCORES -gt 0 ]] && [[ CORES -gt MAXCORES ]] && rlRun "CORES=$MAXCORES" 0 "Limit max used cores" fi if [ -n "$QUICK" ]; then