Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c24fa14

Browse filesBrowse files
jbergstroemMyles Borins
authored andcommitted
test: inherit JOBS from environment
In some virtualized environments the amount of available resources are misleading; for instance `multiprocessing.cpu_count()` on our current 4-core smartos vm's returns `48`. This is not a bug, merely how the vm host provides information about available hardware. Avoid running into issues by overriding `cpu_count()` with `JOBS`. PR-URL: #4495 Reviewed-By: Brian White <mscdex@mscdex.net>
1 parent 7dc90e9 commit c24fa14
Copy full SHA for c24fa14

File tree

Expand file treeCollapse file tree

1 file changed

+4
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-1
lines changed
Open diff view settings
Collapse file

‎tools/test.py‎

Copy file name to clipboardExpand all lines: tools/test.py
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1337,7 +1337,10 @@ def ProcessOptions(options):
13371337
print "The test group to run (n) must be smaller than number of groups (m)."
13381338
return False
13391339
if options.J:
1340-
options.j = multiprocessing.cpu_count()
1340+
# inherit JOBS from environment if provided. some virtualised systems
1341+
# tends to exaggerate the number of available cpus/cores.
1342+
cores = os.environ.get('JOBS')
1343+
options.j = int(cores) if cores is not None else multiprocessing.cpu_count()
13411344
if options.flaky_tests not in ["run", "skip", "dontcare"]:
13421345
print "Unknown flaky-tests mode %s" % options.flaky_tests
13431346
return False

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.