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

RuntimeWarning: deallocating CachingFileManager during main test execution #390

Open
chuckwondo opened this issue Jan 27, 2025 · 5 comments

Comments

@chuckwondo
Copy link
Contributor

Similar to #385, there are dozens (over 60 as of this writing!) of the following warnings emitted during execution of the main tests:

RuntimeWarning: deallocating CachingFileManager(...), but file is not already closed. This may indicate a bug.

This is again due to failing to properly close open files in tests/fixtures, so does not appear to be indicative of any virtualizarr bug, but the volume of messages is quite disconcerting to anybody looking at the job logs. Further, these might lead to testing problems at some point in time.

Cleaning up these warnings should more readily make potentially more concerning problems more visible to those who keep an eye on such logs.

@sharkinsspatial
Copy link
Collaborator

@chuckwondo We may want to consider following the xarray approach of disallowing internal warnings outlined in this issue pydata/xarray#3266 (where the xarray test suite was also issuing the same warning from the netcdf4 library).

@chuckwondo
Copy link
Contributor Author

@chuckwondo We may want to consider following the xarray approach of disallowing internal warnings outlined in this issue pydata/xarray#3266 (where the xarray test suite was also issuing the same warning from the netcdf4 library).

If I'm reading that correctly, I believe that's a separate issue.

However, it may also be applicable to this repo, but not for the warnings I noted above. The ones above are due to failing to close file pointers. For this particular issue, we want to be properly using context managers in our tests.

Other warnings not due to failing to close file pointers we may certainly want to silence appropriately, to also avoid extraneous logging output that might make it hard to see actual problems.

@chuckwondo
Copy link
Contributor Author

@sharkinsspatial, for reference, see what I did here: #386

@TomNicholas
Copy link
Member

Was this closed by #386 @chuckwondo ?

@chuckwondo
Copy link
Contributor Author

Was this closed by #386 @chuckwondo ?

No, that was a separate set of warnings. The 2 sets of warnings appear for different github workflows. The ones in #386 appear in the upstream tests, whereas the ones here appear in the main tests.

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

No branches or pull requests

3 participants