diff --git a/tests/tests_integration/test_api/test_data_workflows.py b/tests/tests_integration/test_api/test_data_workflows.py index 355e1e4b17..3d91542bc6 100644 --- a/tests/tests_integration/test_api/test_data_workflows.py +++ b/tests/tests_integration/test_api/test_data_workflows.py @@ -392,10 +392,12 @@ def test_retrieve_workflow_execution_detailed( cognite_client: CogniteClient, workflow_execution_list: WorkflowExecutionList, ) -> None: - assert workflow_execution_list, "There should be at least one workflow execution to test retrieve detailed with" - retrieved = cognite_client.workflows.executions.retrieve_detailed(workflow_execution_list[0].id) - - assert retrieved.as_execution().dump() == workflow_execution_list[0].dump() + workflow_execution_completed = cognite_client.workflows.executions.list(statuses="completed", limit=1) + assert ( + workflow_execution_completed + ), "There should be at least one workflow execution to test retrieve detailed with" + retrieved = cognite_client.workflows.executions.retrieve_detailed(workflow_execution_completed[0].id) + assert retrieved.as_execution().dump() == workflow_execution_completed[0].dump() assert retrieved.executed_tasks def test_retrieve_non_existing_workflow_execution(self, cognite_client: CogniteClient) -> None: