fix(data workflow tests): cancel running workflow executions before delete#2701
fix(data workflow tests): cancel running workflow executions before delete#2701vincent-cognite wants to merge 24 commits into
Conversation
…ration tests Workflow API now rejects deletion while executions are still running (CDF-28136). Update workflow integration test teardown to cancel running executions first so cleanup does not fail against the new guard. Co-authored-by: Cursor <cursoragent@cursor.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2701 +/- ##
==========================================
- Coverage 93.68% 93.60% -0.08%
==========================================
Files 503 503
Lines 50696 50778 +82
==========================================
+ Hits 47494 47533 +39
- Misses 3202 3245 +43
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review
This pull request introduces helper functions _cancel_running_executions_for_workflow and _safe_delete_workflows in the integration tests to cancel active executions before deleting workflows, ensuring cleaner teardowns. The review feedback suggests improving robustness by wrapping execution cancellation in try...except CogniteAPIError blocks to prevent test flakiness if executions are already completed, and to properly respect the ignore_unknown_ids flag when attempting to cancel executions for non-existent workflows.
… fixtures Use test-scoped workflow executions so listing is not polluted by executions created by other tests on the same session-scoped version. Co-authored-by: Cursor <cursoragent@cursor.com>
… IDs Ignore CogniteAPIError when cancelling executions that finish between list and cancel, and skip cancellation for unknown workflows when ignore_unknown_ids is enabled. Co-authored-by: Cursor <cursoragent@cursor.com>
Pull request was converted to draft
…h://github.com/cognitedata/cognite-sdk-python into CDF-28136-fix-workflow-integration-test-teardown
There was a problem hiding this comment.
Code Review
This pull request improves the stability and cleanup of workflow integration tests by introducing helper functions to cancel running executions before deleting workflows or versions, and isolating permanent workflows per pytest-xdist worker to prevent race conditions. The reviewer recommended optimizing the _safe_delete_workflows helper by batching workflow retrieval calls to avoid an N+1 query pattern, which will speed up the test cleanup process.
|
too invasive and complicated |
Improve test harness for workflows:
RUNNING(jazz-api#2424, CDF-28136).test_trigger_cancel_retry_workflow.