Skip to content

cache: last_failed_paths might crash with ELOOP / does not honor/use args #5624

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

Closed
blueyed opened this issue Jul 18, 2019 · 0 comments
Closed
Labels
plugin: cache related to the cache builtin plugin topic: collection related to the collection phase type: bug problem that needs to be addressed type: regression indicates a problem that was introduced in a release which was working previously

Comments

@blueyed
Copy link
Contributor

blueyed commented Jul 18, 2019

% COLUMNS=80 p --lf testing
============================= test session starts ==============================
platform linux -- Python 3.7.3, pytest-4.6.1.dev186+gc9923a3a5, py-1.8.0, pluggy-0.12.0
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('…/Vcs/pytest/.hypothesis/examples')
rootdir: …/Vcs/pytest, inifile: tox.ini, testpaths: testing
plugins: hypothesis-4.23.8
collected 0 items / 1 errors
run-last-failure: 335 known failures not in selected tests

==================================== ERRORS ====================================
________________________ ERROR collecting test session _________________________
src/_pytest/cacheprovider.py:161: in last_failed_paths
    return self._last_failed_paths
E   AttributeError: 'LFPlugin' object has no attribute '_last_failed_paths'

During handling of the above exception, another exception occurred:
.venv/lib/python3.7/site-packages/pluggy/hooks.py:291: in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
.venv/lib/python3.7/site-packages/pluggy/manager.py:87: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
.venv/lib/python3.7/site-packages/pluggy/manager.py:81: in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
src/_pytest/cacheprovider.py:175: in pytest_ignore_collect
    last_failed_paths = self.last_failed_paths()
src/_pytest/cacheprovider.py:165: in last_failed_paths
    result = {x for x in result if x.exists()}
src/_pytest/cacheprovider.py:165: in <setcomp>
    result = {x for x in result if x.exists()}
/usr/lib/python3.7/pathlib.py:1339: in exists
    self.stat()
/usr/lib/python3.7/pathlib.py:1161: in stat
    return self._accessor.stat(self)
E   OSError: [Errno 40] Too many levels of symbolic links: '…/Vcs/pytest/issue-4782/pkg/test_symlink.py'
=========================== short test summary info ============================
FAILED  - OSError: [Errno 40] Too many levels of symbolic links: '/home/danie...
!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!
=========================== 1 error in 0.15 seconds ============================

I see two issues here:

  1. it should not crash, but ignore the ELOOP - likely more a Python issue itself though
  2. it should only consider files that would be collected anyway (i.e. using testpaths, or the arg in this case): then it would not look at that looping symlink in the first place.
@blueyed blueyed added type: bug problem that needs to be addressed topic: collection related to the collection phase plugin: cache related to the cache builtin plugin labels Jul 18, 2019
blueyed added a commit to blueyed/pytest that referenced this issue Jul 18, 2019
@blueyed blueyed added the type: regression indicates a problem that was introduced in a release which was working previously label Jul 20, 2019
blueyed added a commit to blueyed/pytest that referenced this issue Oct 16, 2019
blueyed added a commit to blueyed/pytest that referenced this issue Oct 18, 2019
blueyed added a commit to blueyed/pytest that referenced this issue Nov 21, 2019
@blueyed blueyed closed this as completed Nov 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: cache related to the cache builtin plugin topic: collection related to the collection phase type: bug problem that needs to be addressed type: regression indicates a problem that was introduced in a release which was working previously
Projects
None yet
Development

No branches or pull requests

1 participant