Skip to content

Commit

Permalink
Merge pull request #4 from lsst/tickets/DM-16343
Browse files Browse the repository at this point in the history
DM-16343: Limit number of flake8 jobs
  • Loading branch information
timj committed Oct 30, 2018
2 parents e2c92a0 + 47ebee5 commit 39ba427
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions patches/0001-Limit-flake8-to-a-single-job-per-test.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
From 8d08d2ff0e72b600d3ac35fdf22deb9d500f5bb4 Mon Sep 17 00:00:00 2001
From: Tim Jenness <tim.jenness@gmail.com>
Date: Mon, 29 Oct 2018 15:29:19 -0700
Subject: [PATCH] Limit flake8 to a single job per test

Without this change flake8 creates many subprocesses every time
it is invoked. This causes significant overhead and slows down
test execution. In conjunction with pytest-xdist many hundreds
of additional flake8 processes can be created which causes
significant load issues.
---
pytest_flake8.py | 2 ++
1 file changed, 2 insertions(+)

diff --git a/pytest_flake8.py b/pytest_flake8.py
index f379e40..2261857 100644
--- a/pytest_flake8.py
+++ b/pytest_flake8.py
@@ -178,6 +178,8 @@ def check_file(path, flake8ignore, maxlength, maxcomplexity,
args += ['--show-source']
if statistics:
args += ['--statistics']
+ # One file per flake8 call so limit flake8 to one job
+ args += ['--jobs', "1"]
app = application.Application()
app.parse_preliminary_options_and_args(args)
app.make_config_finder()
--
2.19.1

0 comments on commit 39ba427

Please sign in to comment.