test_reaper.py and test_reaper2.py run the reaper, but nothing is ever deleted as the source column in rse_usage is set to srm when generating the test data, but (by default) this is storage for the RSE being used in the test. There replicas also need a tombstone set on them, which they don't have. As a result we never delete anything, but also never assert that we have so the test passes.
There's also a potential bug in the way we decide how many files to delete. If you set the RSE limits to require 10GB of free space, currently have 1GB of space free, and several 2GB files stored on the RSE, instead of deleting 5 files to give 11GB of free space, we delete 4 and end up with 9GB. This is due to the order in which we check file size vs adding the replica to a list of files to be deleted in core.replica.list_unlocked_replicas.
As I've made changes to the reaper (to allow VO to be specified), I need working reaper tests to make sure I haven't broken anything. However this is not a solely multi-VO issue, so this may need a PR against the mainline development too (rather than it going in as part of the larger multi-VO development PRs).
Modification
Change source and add tombstones to allow deletion, and add some asserts to the reaper tests. Change how we calculate the number of files that need reaping.
Motivation
test_reaper.py
andtest_reaper2.py
run the reaper, but nothing is ever deleted as thesource
column inrse_usage
is set tosrm
when generating the test data, but (by default) this isstorage
for the RSE being used in the test. There replicas also need a tombstone set on them, which they don't have. As a result we never delete anything, but also never assert that we have so the test passes.There's also a potential bug in the way we decide how many files to delete. If you set the RSE limits to require 10GB of free space, currently have 1GB of space free, and several 2GB files stored on the RSE, instead of deleting 5 files to give 11GB of free space, we delete 4 and end up with 9GB. This is due to the order in which we check file size vs adding the replica to a list of files to be deleted in
core.replica.list_unlocked_replicas
.As I've made changes to the reaper (to allow VO to be specified), I need working reaper tests to make sure I haven't broken anything. However this is not a solely multi-VO issue, so this may need a PR against the mainline development too (rather than it going in as part of the larger multi-VO development PRs).
Modification
Change
source
and add tombstones to allow deletion, and add some asserts to the reaper tests. Change how we calculate the number of files that need reaping.