-
-
Notifications
You must be signed in to change notification settings - Fork 646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PytestRun apparently broken by pytest 3.7.0 #6282
Comments
This is an attempt to stop the bleeding noted in pantsbuild#6282.
I don't really have a minimal repro for this one, because even forcing EDIT: Ah, correction:
repros. |
This is also seemingly non-deterministic... a different set of tests fails each time. |
The
|
### Problem As described in #6282, pytest `3.7` introduces a non-deterministic `ZipImportError`. ### Solution Bound pants' usage of pytest below `3.7`. This subsumes #6283: the hypothesis is that because `tests/python/pants_test/backend/python/tasks/test_pytest_run.py` creates synthetic scopes for its tasks, options in `pants.ini` (as opposed to Subsystem defaults) are not applied. ### Result Works around #6282.
### Problem As described in #6282, pytest `3.7` introduces a non-deterministic `ZipImportError`. ### Solution Bound pants' usage of pytest below `3.7`. This subsumes #6283: the hypothesis is that because `tests/python/pants_test/backend/python/tasks/test_pytest_run.py` creates synthetic scopes for its tasks, options in `pants.ini` (as opposed to Subsystem defaults) are not applied. ### Result Works around #6282.
### Problem As described in pantsbuild#6282, pytest `3.7` introduces a non-deterministic `ZipImportError`. ### Solution Bound pants' usage of pytest below `3.7`. This subsumes pantsbuild#6283: the hypothesis is that because `tests/python/pants_test/backend/python/tasks/test_pytest_run.py` creates synthetic scopes for its tasks, options in `pants.ini` (as opposed to Subsystem defaults) are not applied. ### Result Works around pantsbuild#6282.
Nice. I do repro and then fix by: diff --git a/3rdparty/python/requirements.txt b/3rdparty/python/requirements.txt
index 5811ad431..cfc5c0cf2 100644
--- a/3rdparty/python/requirements.txt
+++ b/3rdparty/python/requirements.txt
@@ -27,7 +27,7 @@ pywatchman==1.4.1
requests[security]>=2.5.0,<2.19
scandir==1.2
setproctitle==1.1.10
-setuptools==33.1.1
+setuptools==30.0.0
six>=1.9.0,<2
subprocess32==3.2.7 ; python_version<'3'
thrift>=0.9.1
diff --git a/src/python/pants/backend/python/subsystems/python_setup.py b/src/python/pants/backend/python/subsystems/python_setup.py
index 9eead0359..cbec22f17 100644
--- a/src/python/pants/backend/python/subsystems/python_setup.py
+++ b/src/python/pants/backend/python/subsystems/python_setup.py
@@ -26,7 +26,7 @@ class PythonSetup(Subsystem):
"or 'PyPy' (A pypy interpreter of any version). Multiple constraint strings will "
"be ORed together. These constraints are applied in addition to any "
"compatibilities required by the relevant targets.")
- register('--setuptools-version', advanced=True, default='33.1.1',
+ register('--setuptools-version', advanced=True, default='30.0.0',
help='The setuptools version for this python environment.')
register('--wheel-version', advanced=True, default='0.29.0',
help='The wheel version for this python environment.') Which undoes #6225. Digging more in #6225 to see if a compromise can be reached. |
@jsirois : I also just determined that is related to the interplay between the two test methods in that class: I was able to confirm that running either method in isolation doesn't repro. So I think that it may be some nastiness related to re-using the interpreter cache between the two tests...? |
And reverting bd434de with the patch above in effect (setuptools pinned lower), also green. Thanks Stu - pondering... |
Notes: likely the root problem is the zipimporter cache issue described here: pypa/setuptools#168 (comment) I'm pretty sure we hit this in the dim past of pex / pants. I'll dig along these lines this morning. |
And the underlying python issue, a good read: https://bugs.python.org/issue19081 |
I have a workaround for this for #6289, although fixing the underlying issue would continue to be awesome. |
OK - we hit this |
This fixes zipimporter issues noted in pantsbuild#6282 and is generally desirable in the absence of severe performance degradation. Fixes pantsbuild#6282
### Problem As described in pantsbuild#6282, pytest `3.7` introduces a non-deterministic `ZipImportError`. ### Solution Bound pants' usage of pytest below `3.7`. This subsumes pantsbuild#6283: the hypothesis is that because `tests/python/pants_test/backend/python/tasks/test_pytest_run.py` creates synthetic scopes for its tasks, options in `pants.ini` (as opposed to Subsystem defaults) are not applied. ### Result Works around pantsbuild#6282.
This undoes the workarounds introduced for pantsbuild#6282. Fixes pantsbuild#6282
This fixes zipimporter issues noted in pantsbuild#6282 and is generally desirable in the absence of severe performance degradation. Fixes pantsbuild#6282
It looks like this pytest PR which landed in pytest 3.7.0 on 7/31/2018 breaks our custom node hook:
pants/src/python/pants/backend/python/tasks/pytest_run.py
Lines 391 to 454 in 4a4e481
Still investigating.
The text was updated successfully, but these errors were encountered: