run-tests: make -j use CPU count by default

Summary:
Given the multi-core era, it seems to be a good default to make use of all
available cores. Use `-j 1` to get the old behavior.

Reviewed By: phillco

Differential Revision: D6752704

fbshipit-source-id: 842ddea1d89160eed030fc71ba08024859db9268
This commit is contained in:
Jun Wu 2018-01-23 12:08:23 -08:00 committed by Saurabh Singh
parent 07522dbb4e
commit 0d7d81e0c2
2 changed files with 7 additions and 6 deletions

View File

@ -18,13 +18,13 @@
# sample of test scripts. For example:
#
# 1) serial, no coverage, temp install:
# ./run-tests.py test-s*
# ./run-tests.py -j1 test-s*
# 2) serial, no coverage, local hg:
# ./run-tests.py --local test-s*
# ./run-tests.py -j1 --local test-s*
# 3) serial, coverage, temp install:
# ./run-tests.py -c test-s*
# ./run-tests.py -j1 -c test-s*
# 4) serial, coverage, local hg:
# ./run-tests.py -c --local test-s* # unsupported
# ./run-tests.py -j1 -c --local test-s* # unsupported
# 5) parallel, no coverage, temp install:
# ./run-tests.py -j2 test-s*
# 6) parallel, no coverage, local hg:
@ -51,6 +51,7 @@ import difflib
import distutils.version as version
import errno
import json
import multiprocessing
import os
import random
import re
@ -248,7 +249,7 @@ if 'java' in sys.platform:
IMPL_PATH = b'JYTHONPATH'
defaults = {
'jobs': ('HGTEST_JOBS', 1),
'jobs': ('HGTEST_JOBS', multiprocessing.cpu_count()),
'timeout': ('HGTEST_TIMEOUT', 180),
'slowtimeout': ('HGTEST_SLOWTIMEOUT', 500),
'port': ('HGTEST_PORT', 20059),

View File

@ -15,7 +15,7 @@ Define a helper to avoid the install step
=============
$ rt()
> {
> run-tests.py --with-hg=`which hg` "$@"
> run-tests.py --with-hg=`which hg` -j 1 "$@"
> }
error paths