Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Calculate parallel jobs based on available CPUs
We're going to enable new ARM64 runners in CI, where test-run is invoked in a Docker container. At the same time, the runner is an LXD container created by the service provider. In this circumstances, the Docker container sees all the 128 online CPUs, but the runner may have only some of them available (depending on the pricing plan). Python 3.3+ has a function to determine available CPUs, so we can reduce the parallelism to this value. We falls back to the online CPUs count on Python < 3.3. After this change, test-run follows a CPU affinity mask set by `taskset` (and, I guess, by `numactl`). The change is similar to replacing `nproc --all` to `nproc`. The change only affects the default behavior, which can be overwritten by passing the `--jobs` (or `-j`) CLI option or using the `TEST_RUN_JOBS` environment variable. Reported in tarantool/tarantool#10102 (see a discussion thread).
- Loading branch information