Skip to content
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

Adds a memory leak check after running a unit test #1798

Open
wants to merge 2 commits into
base: unstable
Choose a base branch
from

Conversation

rjd15372
Copy link
Member

This commit adds check after each test function execution of a unit test, that checks if there is still memory allocated.

This check prevents situations where tests, which do these kind of checks, fail due to memory leaks caused by previous tests.

This commit adds check after each test function execution of a unit
test, that checks if there is still memory allocated.

This check prevents situations where tests, which do these kind of checks,
fail due to memory leaks caused by previous tests.

Signed-off-by: Ricardo Dias <[email protected]>
Signed-off-by: Ricardo Dias <[email protected]>
Copy link

codecov bot commented Feb 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.99%. Comparing base (4966357) to head (b02f1bc).
Report is 4 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #1798      +/-   ##
============================================
+ Coverage     70.97%   70.99%   +0.02%     
============================================
  Files           123      123              
  Lines         65645    65648       +3     
============================================
+ Hits          46590    46607      +17     
+ Misses        19055    19041      -14     

see 30 files with indirect coverage changes

@madolson
Copy link
Member

Seems to be a lot of memory leaks though :/

@zuiderkwast
Copy link
Contributor

Seems to be a lot of memory leaks though :/

Hm... Are the test cases not independent? If not, then maybe we should just detect leaks between each suite...?

@madolson
Copy link
Member

madolson commented Feb 27, 2025

Yeah, it looks like the listpack tests are cumulative, which is interesting. We should probably make each one self contained, so we can run it without the others.

@zuiderkwast
Copy link
Contributor

Yeah, it looks like the listpack tests are cumulative, which is interesting. We should probably make each one self contained, so we can run it without the others.

There's currently no way to run a single test case though. It'd be more work to refactor these tests so I suggest we just check mem leaks per suite. It's much easier.

@madolson
Copy link
Member

There's currently no way to run a single test case though. It'd be more work to refactor these tests so I suggest we just check mem leaks per suite. It's much easier.

I'm okay with that for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants