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

[24.0] Don't set file size to zero #18653

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions lib/galaxy/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4211,8 +4211,6 @@ def full_delete(self):
# TODO: purge metadata files
self.deleted = True
self.purged = True
self.file_size = 0
self.total_size = 0

def get_access_roles(self, security_agent):
roles = []
Expand Down
13 changes: 13 additions & 0 deletions lib/galaxy_test/api/test_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,19 @@ def _run_cancel_job(self, history_id: str, use_query_params: bool = False):
deleted_job_details = self.dataset_populator.get_job_details(job_id).json()
assert deleted_job_details["state"] in ("deleting", "deleted"), deleted_job_details

def test_purge_does_not_reset_file_size(self):
with self.dataset_populator.test_history() as history_id:
dataset = self.dataset_populator.new_dataset(history_id=history_id, content="ABC", wait=True)
assert dataset["file_size"]
self.dataset_populator.delete_dataset(
history_id=history_id, content_id=dataset["id"], purge=True, wait_for_purge=True
)
purged_dataset = self.dataset_populator.get_history_dataset_details(
history_id=history_id, content_id=dataset["id"]
)
assert purged_dataset["purged"]
assert dataset["file_size"] == purged_dataset["file_size"]

def test_delete_batch(self):
num_datasets = 4
dataset_map: Dict[int, str] = {}
Expand Down
Loading