Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cognite/extractorutils/unstable/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions tests/test_unstable/test_action_dispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand Down Expand Up @@ -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:
Expand Down
Loading