Bug 1476390 - [python-test] Default number of processes to multiprocessing.cpu_count() r=davehunt
Differential Revision: https://phabricator.services.mozilla.com/D2201
This commit is contained in:
@@ -9,6 +9,7 @@ import logging
|
||||
import os
|
||||
import sys
|
||||
import tempfile
|
||||
from multiprocessing import cpu_count
|
||||
|
||||
from concurrent.futures import (
|
||||
ThreadPoolExecutor,
|
||||
@@ -73,9 +74,10 @@ class MachCommands(MachCommandBase):
|
||||
'Python version, Pipenv will automatically scan your '
|
||||
'system for a Python that matches that given version.')
|
||||
@CommandArgument('-j', '--jobs',
|
||||
default=1,
|
||||
default=None,
|
||||
type=int,
|
||||
help='Number of concurrent jobs to run. Default is 1.')
|
||||
help='Number of concurrent jobs to run. Default is the number of CPUs '
|
||||
'in the system.')
|
||||
@CommandArgument('--subsuite',
|
||||
default=None,
|
||||
help=('Python subsuite to run. If not specified, all subsuites are run. '
|
||||
@@ -97,7 +99,7 @@ class MachCommands(MachCommandBase):
|
||||
test_objects=None,
|
||||
subsuite=None,
|
||||
verbose=False,
|
||||
jobs=1,
|
||||
jobs=None,
|
||||
python=None,
|
||||
**kwargs):
|
||||
self.activate_pipenv(pipfile=None, populate=True, python=python)
|
||||
@@ -143,7 +145,7 @@ class MachCommands(MachCommandBase):
|
||||
else:
|
||||
parallel.append(test)
|
||||
|
||||
self.jobs = jobs
|
||||
self.jobs = jobs or cpu_count()
|
||||
self.terminate = False
|
||||
self.verbose = verbose
|
||||
|
||||
|
||||
Reference in New Issue
Block a user