pytest-dev / pytest-dev/pytest

test_exception_handling_no_traceback leaking FDs (LsofFdLeakChecker plugin)

Open
#2,366 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: refactoring
Dominant language
Python
Stars
14.5k
Forks
3.4k
Avg merge
2d 9h
Merged PRs (30d)
35

Description

While implementing #2292, it was discovered that LsofFdLeakChecker plugin declares a hook wrapper incorrectly as pytest_runtest_item instead of pytest_runtest_protocol.

AFAICT, the hook was introduced in db5649ec6a8fcd9ef148b9f77797a22cb9f3cda1 already using the incorrect name, so it seems it never checked for leaked file descriptors. @hpk42 could you comment here?

Fixing the hook name enabled the plugin and it is now crashing the test suite because of some leaked fds (example log).

In order to move #2292 forward, the plugin was changed to emit a warning instead of failing the suite.

We need to decide if we want to keep the plugin and fix the tests, or just remove it altogether.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect the LsofFdLeakChecker plugin and its pytest_runtest_protocol hook, then review the leaked-file-descriptor example log and the changes made for #2292. Done means deciding whether to keep and repair the plugin by fixing the affected tests, or remove it altogether.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.