From 3b4f8ba535434ad914bd561c4d2fa2d78ccce8b3 Mon Sep 17 00:00:00 2001 From: vikramlc Date: Wed, 26 Aug 2026 11:11:16 +0530 Subject: [PATCH] fix(odin): Update stop action status to succeeded instead of canceled --- cognite/extractorutils/unstable/core/base.py | 2 +- tests/test_unstable/test_action_dispatch.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cognite/extractorutils/unstable/core/base.py b/cognite/extractorutils/unstable/core/base.py index cf1a8e05..52225dae 100644 --- a/cognite/extractorutils/unstable/core/base.py +++ b/cognite/extractorutils/unstable/core/base.py @@ -696,7 +696,7 @@ def _handle_stop_task_action(self, action: Action) -> None: return self._checkin_worker.queue_action_update( - ActionUpdate(external_id=action.external_id, status=ActionStatus.canceled) + ActionUpdate(external_id=action.external_id, status=ActionStatus.succeeded) ) def _handle_custom_action(self, action: Action) -> None: diff --git a/tests/test_unstable/test_action_dispatch.py b/tests/test_unstable/test_action_dispatch.py index 488e14f4..bace9c58 100644 --- a/tests/test_unstable/test_action_dispatch.py +++ b/tests/test_unstable/test_action_dispatch.py @@ -121,7 +121,7 @@ def test_stop_task_action_not_running_reports_failed() -> None: assert "not currently running" in (updates[0].result_message or "") -def test_stop_task_action_cancels_child_token_and_reports_canceled() -> None: +def test_stop_task_action_cancels_child_token_and_reports_succeeded() -> None: extractor = _make_extractor() task_started = Event() allow_exit = Event() @@ -140,7 +140,7 @@ def cancellable(ctx: TaskContext) -> None: extractor._dispatch_single_action(_make_action("act-stop", "Stop worker")) updates = _queued_updates(extractor) - assert any(u.status == ActionStatus.canceled and u.external_id == "act-stop" for u in updates) + assert any(u.status == ActionStatus.succeeded and u.external_id == "act-stop" for u in updates) assert token is not None and token.is_cancelled allow_exit.set() @@ -206,7 +206,7 @@ def cancellable(ctx: TaskContext) -> None: extractor._dispatch_single_action(_make_action("act-stop", "Stop listener")) updates = _queued_updates(extractor) - assert any(u.status == ActionStatus.canceled and u.external_id == "act-stop" for u in updates) + assert any(u.status == ActionStatus.succeeded and u.external_id == "act-stop" for u in updates) assert task_exited.wait(timeout=5) deadline = time.monotonic() + 5 while "listener" in extractor._running_task_tokens and time.monotonic() < deadline: