From 3a63b3f29acf1a7ee9c54bea87ef5db59ab55f11 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Wed, 14 Oct 2020 06:56:24 +0200 Subject: [PATCH] Fix pylint downscaling max() was bogus -- we want *both* RAM and number of CPUs to limit the number of jobs, not take whichever is highest. [1] https://github.com/PyCQA/pylint/issues/1495 [2] https://github.com/PyCQA/pylint/issues/3899 Cherry-picked from master PR #2923 Related: rhbz#1885635 --- tests/pylint/censorship.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pylint/censorship.py b/tests/pylint/censorship.py index 04a7e6874473..8dbea68ded6d 100755 --- a/tests/pylint/censorship.py +++ b/tests/pylint/censorship.py @@ -128,7 +128,7 @@ def _prepare_args(self): # each process uses ~ 1.5 GiB RAM, leave some breathing space jobs = min(1, avail_mem_kb // 2000000) # but also clip to nproc - jobs = max(jobs, num_cpus) + jobs = min(jobs, num_cpus) print("Using", jobs, "parallel jobs based on", avail_mem_kb, "kB available RAM and", num_cpus, "CPUs") args.append("-j%i" % jobs)