Skip to content

Commit

Permalink
Fix pylint downscaling
Browse files Browse the repository at this point in the history
max() was bogus -- we want *both* RAM and number of CPUs to limit the
number of jobs, not take whichever is highest.

[1] pylint-dev/pylint#1495
[2] pylint-dev/pylint#3899

Cherry-picked from master PR rhinstaller#2923

Related: rhbz#1885635
  • Loading branch information
martinpitt committed Oct 14, 2020
1 parent 35095b2 commit 3a63b3f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/pylint/censorship.py
Expand Up @@ -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)
Expand Down

0 comments on commit 3a63b3f

Please sign in to comment.