Fix resource warnings: unclosed sockets / SSL sockets / a PEM file#290
Open
kurtmckee wants to merge 1 commit intovalkey-io:mainfrom
Open
Fix resource warnings: unclosed sockets / SSL sockets / a PEM file#290kurtmckee wants to merge 1 commit intovalkey-io:mainfrom
kurtmckee wants to merge 1 commit intovalkey-io:mainfrom
Conversation
This fixes a number of resource warnings reported by pytest. One exists in the test suite itself -- an unclosed PEM file -- but the rest are unclosed sockets and SSL sockets. The warnings shown below are representative: ``` ResourceWarning: unclosed <ssl.SSLSocket ...> ResourceWarning: unclosed <socket.socket ...> ResourceWarning: unclosed file <_io.BufferedReader name='dockers/stunnel/keys/server-cert.pem'> ``` Signed-off-by: Kurt McKee <[email protected]>
bogdanp05
approved these changes
Apr 1, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #290 +/- ##
==========================================
- Coverage 76.41% 76.37% -0.04%
==========================================
Files 129 129
Lines 34065 34076 +11
==========================================
- Hits 26031 26027 -4
- Misses 8034 8049 +15 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
|
The patch coverage warning occurs because the test suite doesn't test with the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of change
This fixes a number of resource warnings reported by pytest.
One exists in the test suite itself -- an unclosed PEM file -- but the rest are unclosed sockets and SSL sockets that are problems in the package itself.
The warnings shown below are representative:
Note
This PR DOES NOT resolve all of the warnings that are thrown in the test suite!
There is a lot of work to do on the test suite's warnings, but this is an initial salvo that resolves the warnings that are displayed when running
make testslocally.Pull Request check-list