HomePhabricator

Use os.cpu_count in test_runner instead of multiprocessing

Description

Use os.cpu_count in test_runner instead of multiprocessing

Summary:
This eliminates unnecessarily importing multiprocessing. multiprocessing.cpu_count() just calls os.cpu_count() anyway:
https://github.com/python/cpython/blob/main/Lib/multiprocessing/context.py#L43

The or 1 keeps the linter happy since os.cpu_count() can return None in some rare cases.

Test Plan:

ninja check-functional

Reviewers: O1 Bitcoin ABC, #bitcoin_abc, PiRK

Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D17327

Details

Provenance
roqqitAuthored on Mon, Dec 9, 19:26
roqqitPushed on Mon, Dec 9, 21:12
Reviewer
Restricted Owners Package
Differential Revision
D17327: Use os.cpu_count in test_runner instead of multiprocessing
Parents
rABC7bbaf91b122d: [chronik] Bump karyon dependency to 0.1.8
Branches
Unknown
Tags
Unknown