paperless-ngx: re-add xdist
Without it the tests run in ~12 1/2 minutes. With it and max 8 cores they only take 2 1/2 minutes but sometimes fail. Lets max at 4 which takes 3 1/2 minutes. Upstream maxes at 16 by default which doesn't work for us.
This commit is contained in:
@@ -161,9 +161,12 @@ python.pkgs.buildPythonApplication rec {
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
# pytest-xdist makes the tests flaky
|
||||
# pytest-xdist with to many threads makes the tests flaky
|
||||
if (( $NIX_BUILD_CORES > 4)); then
|
||||
NIX_BUILD_CORES=4
|
||||
fi
|
||||
substituteInPlace src/setup.cfg \
|
||||
--replace-fail "--numprocesses auto --maxprocesses=16" ""
|
||||
--replace-fail "--numprocesses auto --maxprocesses=16" "--numprocesses $NIX_BUILD_CORES"
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
@@ -277,9 +280,13 @@ python.pkgs.buildPythonApplication rec {
|
||||
pytest-httpx
|
||||
pytest-mock
|
||||
pytest-rerunfailures
|
||||
pytest-xdist
|
||||
pytestCheckHook
|
||||
];
|
||||
|
||||
# manually managed in postPatch
|
||||
dontUsePytestXdist = false;
|
||||
|
||||
pytestFlagsArray = [
|
||||
"src"
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user