-
Notifications
You must be signed in to change notification settings - Fork 913
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
pyln-testing: Fix BitcoinD FD leak #7669
pyln-testing: Fix BitcoinD FD leak #7669
Conversation
79ed2f7
to
9b37592
Compare
Refactored the file closing operations into a function on |
f680adf
to
8ada6a6
Compare
8ada6a6
to
187bd82
Compare
…sProject#7130]) Changelog-Fixed: pyln-testing: Fix file descriptor leak in bitcoind fixture. ([ElementsProject#7130])
187bd82
to
e35e3c5
Compare
Rebased and removed modifications to CHANGELOG for |
@s373nZ Sorry if I overlooked it while jumping between 7669, 7108, 7130, and 7310 :). I am testing it with:
And it seems to be working (tests are still running at 32% :-|). |
@ShahanaFarooqui That's a lot of jumping (and a lot of 7s :). I should have done a better job at consolidating this information into the PR description. ContextFor some context, I ran into this file descriptor issue a few months ago when working on a PR and attempting to run the To address your questions directly:
My reading of the Pytest documentation suggested by @cdecker in that comment, specifically the preceding section titled Teardown/Cleanup (AKA Fixture finalization), suggests that The following section in the docs, Adding finalizers directly reads to apply typically to non-yield fixtures. Seeing as this is actually an issue with every test case which leverages the In short, the implementation in this PR is indeed using finalizers, but in accordance with yield fixtures rather than
This is a good question, and one I tried to implement initially. Now that it's discovered
So, I believe the subprocess is taking care of closing Alternative implementations
Hope this helps! I haven't mastered Pytest, Pyln, or the CLN test suite by any means, so please let me know if you have recommendations for a better fit solution. |
Also, I have one tangential question, if you would. When referencing issues in the git commit messages, I've been using the Github issue number that describes the problem both in the first line of the commit message and in the |
Typically, including the issue number in commit messages is useful for tracking purposes. It is recommended to reference issues using CHANGELOG list update:Before each release, the changelog.py script generates entries based on commits merged after the last tag. For instance, the script will produce below entry for your commit message, "Changelog-Fixed: pyln-testing: Fix file descriptor leak in bitcoind fixture.":
This way, your changes are automatically included in the appropriate section of the changelog. |
ACK e35e3c5. |
I will merge the PR after final review from @cdecker. |
Fix BitcoinD FD leak in pyln-testing
Description
This PR adds a post-yield resolver sanity-check to the
bitcoind
test fixture to be sure file descriptors are not leaking.Related Issues
Changes Made
Checklist
Ensure the following tasks are completed before submitting the PR:
TODOs
have been addressed or removed.Additional Notes
Please let me know if there is a more elegant way to do this, or more appropriate place to put it.