]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-109649: Fix test_os.test_process_cpu_count_affinity() (#111689)
authorVictor Stinner <vstinner@python.org>
Fri, 3 Nov 2023 23:53:18 +0000 (00:53 +0100)
committerGitHub <noreply@github.com>
Fri, 3 Nov 2023 23:53:18 +0000 (23:53 +0000)
commit244e37b22a826eeb37bc057193bbff7138bc6ac3
tree0b0a03203aa820c7e436d96d5a7d815f2190bc85
parentf21b23058e01515166a6b61fdea01864ad9c0572
gh-109649: Fix test_os.test_process_cpu_count_affinity() (#111689)

When CPUs are isolated on Linux, os.process_cpu_count() is smaller
than os.cpu_count(). Fix the test for this case.

Example with "isolcpus=5,11 rcu_nocbs=5,11" options passed to a Linux
command line to isolated two logical CPUs:

$ ./python -c 'import os; print(os.process_cpu_count(), "/", os.cpu_count())'
10 / 12
Lib/test/test_os.py