From de57d2169a41b199eda68f35e4d14e24a9260558 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Wed, 21 Jan 2026 09:10:48 +0100 Subject: [PATCH] Use wait_for_invocation_and_completion in _run_workflow with wait=True --- lib/galaxy_test/api/test_workflows.py | 10 ++-------- lib/galaxy_test/base/populators.py | 7 ++++++- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/galaxy_test/api/test_workflows.py b/lib/galaxy_test/api/test_workflows.py index 8d998e7c337..e59b9d84044 100644 --- a/lib/galaxy_test/api/test_workflows.py +++ b/lib/galaxy_test/api/test_workflows.py @@ -2256,7 +2256,7 @@ test_data: type: File """, history_id=history_id, - assert_ok=False, + assert_ok=True, wait=True, ) history_contents = self.dataset_populator._get_contents_request(history_id=history_id).json() @@ -2314,7 +2314,7 @@ test_data: collection_type: "list:list:paired" """, history_id=history_id, - assert_ok=False, + assert_ok=True, wait=True, ) invocation = self.workflow_populator.get_invocation(job_summary.invocation_id, step_details=True) @@ -5910,12 +5910,6 @@ test_data: subworkflow_invocation_id = subworkflow_step["subworkflow_invocation_id"] subworkflow_invocation = self.workflow_populator.get_invocation(subworkflow_invocation_id) - - # The subworkflow should have succeeded - assert ( - subworkflow_invocation["state"] == "scheduled" - ), f"Expected subworkflow to succeed, got state: {subworkflow_invocation['state']}" - # Should not have error messages messages = subworkflow_invocation.get("messages", []) assert len(messages) == 0, f"Expected no error messages, got: {messages}" diff --git a/lib/galaxy_test/base/populators.py b/lib/galaxy_test/base/populators.py index 6137aaa6e57..5d01cb54813 100644 --- a/lib/galaxy_test/base/populators.py +++ b/lib/galaxy_test/base/populators.py @@ -2556,7 +2556,12 @@ class BaseWorkflowPopulator(BasePopulator): # Wait for workflow to become fully scheduled and then for all jobs # complete. if wait: - workflow_populator.wait_for_workflow(workflow_id, invocation_id, history_id, assert_ok=assert_ok) + if assert_ok: + workflow_populator.wait_for_invocation_and_completion(invocation_id) + else: + workflow_populator.wait_for_workflow( + workflow_id, invocation_id, history_id, assert_ok=assert_ok + ) jobs.extend(self.dataset_populator.invocation_jobs(invocation_id)) return RunJobsSummary(