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 upstream test execution #385

Closed
chuckwondo opened this issue Jan 23, 2025 · 0 comments · Fixed by #386
Closed

RuntimeWarning: deallocating CachingFileManager during upstream test execution #385

chuckwondo opened this issue Jan 23, 2025 · 0 comments · Fixed by #386

Comments

@chuckwondo
Copy link
Contributor

As of this writing, there are 24 warnings like the following generated during execution of the upstream tests job:

RuntimeWarning: deallocating CachingFileManager(<class 'netCDF4._netCDF4.Dataset'>, '/tmp/pytest-of-root/pytest-0/test_append_with_compression_s0/air2.nc', mode='r', kwargs={'clobber': True, 'diskless': False, 'persist': False, 'format': 'NETCDF4'}, manager_id='de5b096b-ca89-4fe9-9d63-1e5b5cd04d54'), but file is not already closed. This may indicate a bug.

This appears to be 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.

chuckwondo added a commit to chuckwondo/VirtualiZarr that referenced this issue Jan 24, 2025
Use context managers for file handling in tests, eliminating all
occurrences of "RuntimeWarning: deallocating CachingFileManager" during
icechunk test execution.

Fixes zarr-developers#385
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant