Skip to content

Commit 9b4ed93

Browse files
committed
ZenUnitDevOpsPython: Run flake8 with core count - 3 instead of core count to work around a bug in Python multiprocessing on 64-core machines
1 parent 30ecec1 commit 9b4ed93

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

ZenUnitDevOpsPython/Python.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def pylint_file(pythonFilePath: str) -> int:
1414

1515
def run_flake8() -> None:
1616
cpuCount = multiprocessing.cpu_count()
17-
flake8Command = f'flake8 -j {cpuCount} --config=.flake8 --show-source --benchmark'
17+
flake8Command = f'flake8 -j {cpuCount - 3} --config=.flake8 --show-source --benchmark'
1818
Process.fail_fast_run(flake8Command)
1919

2020
def run_mypy() -> None:

ZenUnitDevOpsPythonTests/PythonTests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def test_run_flake8_RunsFlake8WithFlake8Config(_1, _2):
4040
#
4141
Python.run_flake8()
4242
#
43-
expectedFlake8Command = f'flake8 -j {cpuCount} --config=.flake8 --show-source --benchmark'
43+
expectedFlake8Command = f'flake8 -j {cpuCount - 3} --config=.flake8 --show-source --benchmark'
4444
Process.fail_fast_run.assert_called_once_with(expectedFlake8Command)
4545

4646
@staticmethod

ZenUnitDevOpsPythonTests/ZenUnitDevOpsPythonTests.pyproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<ProjectGuid>5be2bd06-b3d6-4e12-9d37-cb82aa0ef9d3</ProjectGuid>
77
<ProjectHome>
88
</ProjectHome>
9-
<StartupFile>PythonTests.py</StartupFile>
9+
<StartupFile>RunAll.py</StartupFile>
1010
<SearchPath>..\</SearchPath>
1111
<WorkingDirectory>..</WorkingDirectory>
1212
<OutputPath>.</OutputPath>

0 commit comments

Comments
 (0)