diff --git a/ophyd_devices/utils/psi_device_base_utils.py b/ophyd_devices/utils/psi_device_base_utils.py index f950ed4..146078c 100644 --- a/ophyd_devices/utils/psi_device_base_utils.py +++ b/ophyd_devices/utils/psi_device_base_utils.py @@ -628,11 +628,13 @@ class ExceptionStatus(CompareStatus): description: str | None = None, ): self._configured_exception = exception + # A watchdog is meant to stay pending for as long as its composite lives; + # inheriting the device default timeout would guarantee a spurious failure. super().__init__( signal=signal, value=value, operation_success=operation, - timeout=timeout, + timeout=NO_TIMEOUT if timeout is None else timeout, settle_time=settle_time, run=run, event_type=event_type, @@ -835,7 +837,9 @@ class TaskHandler: """ task_args = task_args if task_args else () task_kwargs = task_kwargs if task_kwargs else {} - task_status = TaskStatus(self._parent) + # Background tasks are unbounded by design; the device default timeout + # must not fail their status while the task thread is still running. + task_status = TaskStatus(self._parent, timeout=NO_TIMEOUT) thread = threading.Thread( target=self._wrap_task, args=(task, task_args, task_kwargs, task_status), diff --git a/tests/test_utils.py b/tests/test_utils.py index e66a7af..f095bf3 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1186,7 +1186,7 @@ def test_patched_status_types_use_default_timeout_from_object(): TransitionStatus(dev.sig, transitions=[1], run=False), ] - assert [status.timeout for status in statuses] == [3, 3, 3, 4, 3, 3, 3, 3, 3] + assert [status.timeout for status in statuses] == [3, 3, 3, 4, 3, 3, 3, None, 3] def test_patched_status_explicit_timeout_overrides_object_default():