[go: nahoru, domu]

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

[23.0] celery_extended doesn't update disk usage for work dir outputs. #14055

Draft
wants to merge 1 commit into
base: release_23.0
Choose a base branch
from
Draft
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
Test case to demonstrate disk usage update for work dir outputs is br…
…oken with celery_extended.
  • Loading branch information
jmchilton committed Aug 29, 2022
commit e3cac30d03688aa31cfdf7eabf3c26fe8a3925ff
3 changes: 3 additions & 0 deletions lib/galaxy_test/api/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,7 @@ def test_multidata_param(self):
@uses_test_history(require_new=False)
def test_run_cat1(self, history_id):
# Run simple non-upload tool with an input data parameter.
initial_disk_usage = self.dataset_populator.total_disk_usage()
new_dataset = self.dataset_populator.new_dataset(history_id, content="Cat1Test")
inputs = dict(
input1=dataset_to_param(new_dataset),
Expand All @@ -878,6 +879,8 @@ def test_run_cat1(self, history_id):
output1 = outputs[0]
output1_content = self.dataset_populator.get_history_dataset_content(history_id, dataset=output1)
self.assertEqual(output1_content.strip(), "Cat1Test")
final_disk_usage = self.dataset_populator.total_disk_usage()
assert final_disk_usage >= initial_disk_usage + 9 * 2

@skip_without_tool("cat1")
@uses_test_history(require_new=True)
Expand Down
7 changes: 7 additions & 0 deletions lib/galaxy_test/base/populators.py
Original file line number Diff line number Diff line change
Expand Up @@ -1057,6 +1057,13 @@ def user_private_role_id(self) -> str:
assert "id" in role, role
return role["id"]

def total_disk_usage(self) -> float:
response = self._get("users/current")
response.raise_for_status()
user_object = response.json()
assert "total_disk_usage" in user_object
return user_object["total_disk_usage"]

def create_role(self, user_ids: list, description: Optional[str] = None) -> dict:
payload = {
"name": self.get_random_name(prefix="testpop"),
Expand Down
30 changes: 30 additions & 0 deletions test/integration/test_metadata_strategy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from galaxy_test.base.populators import (
DatasetPopulator,
uses_test_history,
)
from galaxy_test.driver.integration_util import IntegrationTestCase


class TestDiskUsageUpdateDefault(IntegrationTestCase):
framework_tool_and_types = True

def setUp(self):
super().setUp()
self.dataset_populator = DatasetPopulator(self.galaxy_interactor)

@uses_test_history(require_new=False)
def test_run_work_dir_glob(self, history_id):
# Run a tool with a work dir glob and ensure content and disk usage is updated.
self.dataset_populator.new_dataset(history_id, content="fwd1Test", wait=True)
initial_disk_usage = self.dataset_populator.total_disk_usage()
response = self.dataset_populator.run_tool("from_work_dir_glob", {}, history_id, assert_ok=True)
self.dataset_populator.wait_for_job(job_id=response["jobs"][0]["id"])
final_disk_usage = self.dataset_populator.total_disk_usage()
assert final_disk_usage == initial_disk_usage + 3


class TestDiskUsageCeleryExtended(TestDiskUsageUpdateDefault):
@classmethod
def handle_galaxy_config_kwds(cls, config):
super().handle_galaxy_config_kwds(config)
config["metadata_strategy"] = "celery_extended"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just trying this, as suggested by Marius, to see if this was somehow related to a possible issue when using Celery that I'm currently investigating (#15821).

What I found out about this is that when the metadata_strategy is set to directory or directory_celery both test success, and they fail with extended and extended_celery so it seems that Celery is not the cause of this problem but something with the extended metadata strategy itself.