Use wait_for_invocation_and_completion in _run_workflow with wait=True

This commit is contained in:
mvdbeek
2026-01-21 14:44:54 +01:00
parent c3099699e9
commit de57d2169a
2 changed files with 8 additions and 9 deletions
+2 -8
View File
@@ -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}"
+6 -1
View File
@@ -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(