tests: nproc: ensure scheduler and OMP_NUM_THREADS are independent

* tests/nproc/nproc-quota-systemd.sh: Explicitly set OMP_NUM_THREADS
to an ignorable value, to ensure scheduler processing is independent.
* tests/nproc/nproc-quota.sh: Likewise for the SCHED_FIFO check.
https://github.com/coreutils/coreutils/pull/290
This commit is contained in:
Pádraig Brady committed 2026-06-18 15:38:18 +01:00
1 parent c5d2f42c43
commit 5800d91721
2 files changed
+5 -2

No files matched your search

+4 -1
View File
@@ -31,7 +31,10 @@ check_sched_quota()
pct=$1; shift
if systemd-run --scope -q -p CPUQuota=$pct chrt $* true; then
test $(systemd-run --scope -q -p CPUQuota=$pct chrt $* nproc) = $cpu ||
test $(systemd-run --scope -q -p CPUQuota=$pct \
chrt $* \
env OMP_NUM_THREADS=0 \
nproc) = $cpu ||
return 1
fi
return 0
+1 -1
View File
@@ -116,7 +116,7 @@ test $(OMP_NUM_THREADS=$ncpus NPROC) -eq $ncpus || fail=1
echo '100000 100000' > $ROOT/sys/fs/cgroup/cpu.max &&
echo 'policy : 1' > $ROOT/proc/self/sched && # No quota for SCHED_FIFO
test $(NPROC) -eq $ncpus || fail=1
test $(OMP_NUM_THREADS= NPROC) -eq $ncpus || fail=1
echo 'policy : 2' > $ROOT/proc/self/sched && # No quota for SCHED_RR
test $(NPROC) -eq $ncpus || fail=1
echo 'policy : 6' > $ROOT/proc/self/sched && # No quota for SCHED_DEADLINE