Skip to content

Commit

Permalink
Merge pull request grpc#1729 from ctiller/its-raining-jobs
Browse files Browse the repository at this point in the history
Make -j on run_tests work as expected
  • Loading branch information
nicolasnoble committed May 27, 2015
2 parents 3097673 + da2220a commit b70a085
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tools/run_tests/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ def __init__(self, config, environ=None):
if environ is None:
environ = {}
self.build_config = config
self.maxjobs = 2 * multiprocessing.cpu_count()
self.allow_hashing = (config != 'gcov')
self.environ = environ
self.environ['CONFIG'] = config
Expand Down Expand Up @@ -93,7 +92,6 @@ def __init__(self, config, tool, args=None):
self.build_config = config
self.tool = tool
self.args = args
self.maxjobs = 2 * multiprocessing.cpu_count()
self.allow_hashing = False

def job_spec(self, cmdline, hash_targets):
Expand Down Expand Up @@ -333,7 +331,7 @@ def __str__(self):
default=_DEFAULT)
argp.add_argument('-n', '--runs_per_test', default=1, type=int)
argp.add_argument('-r', '--regex', default='.*', type=str)
argp.add_argument('-j', '--jobs', default=1000, type=int)
argp.add_argument('-j', '--jobs', default=2 * multiprocessing.cpu_count(), type=int)
argp.add_argument('-s', '--slowdown', default=1.0, type=float)
argp.add_argument('-f', '--forever',
default=False,
Expand Down Expand Up @@ -455,7 +453,7 @@ def _build_and_run(check_cancelled, newline_on_success, travis, cache):
itertools.repeat(one_run, runs_per_test))
if not jobset.run(all_runs, check_cancelled,
newline_on_success=newline_on_success, travis=travis,
maxjobs=min(args.jobs, min(c.maxjobs for c in run_configs)),
maxjobs=args.jobs,
cache=cache):
return 2
finally:
Expand Down

0 comments on commit b70a085

Please sign in to comment.