Skip to content

Commit d2fc47f

Browse files
committed
Don't emit unfinished warnings on workflow cancellation
1 parent 694c106 commit d2fc47f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

temporalio/worker/_workflow_instance.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,6 @@ def is_completion(command):
434434
command.HasField("complete_workflow_execution")
435435
or command.HasField("continue_as_new_workflow_execution")
436436
or command.HasField("fail_workflow_execution")
437-
or command.HasField("cancel_workflow_execution")
438437
)
439438

440439
if any(map(is_completion, self._current_completion.successful.commands)):

tests/worker/test_workflow.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5584,8 +5584,10 @@ class _UnfinishedHandlersOnWorkflowTerminationTest:
55845584
async def test_warning_is_issued_on_exit_with_unfinished_handler(
55855585
self,
55865586
):
5587-
assert await self._run_workflow_and_get_warning() == (
5587+
warning_emitted = await self._run_workflow_and_get_warning()
5588+
assert warning_emitted == (
55885589
self.handler_waiting == "-no-wait-all-handlers-finish-"
5590+
and self.workflow_termination_type != "-cancellation-"
55895591
)
55905592

55915593
async def _run_workflow_and_get_warning(self) -> bool:

0 commit comments

Comments
 (0)