Feature Request; Add support for failing tests that leak memory
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 117
- Forks
- 51
- Avg merge
- 59m
- Merged PRs (30d)
- 3
Description
It would be useful to run rpsec tests with support for reporting and/or failing tests that exercise code that leaves referenced objects around. I had the pleasure of working with a C/C++ test framework that had this support and it was wonderful.
The gem memory_profiler ( https://github.com/SamSaffron/memory_profiler ) has code that makes testing for dangling object references pretty easy, but finding the right place to use that in rspec is difficult. I attempted using memory_profiler in before/after/around callbacks but it wasn't useful because rspec has allocated objects that need to stick around, and the leted variables complicate things even more. memory_profiler can be told to ignore allocations from rspec, but excluding the leted variables (and other test specific allocations) is significantly more difficult.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing memory_profiler's support for detecting referenced objects, then trace how RSpec's before, after, and around callbacks interact with framework allocations and let variables. The work is done when tests can report or fail on leaked references without counting allocations that RSpec or the test setup must retain.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- testing-qa
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100