fix(utils): exclude watchdog and task statuses from the default timeout

This commit is contained in:
wyzula_j committed 2026-09-01 17:14:15 +02:00
1 parent ba892d9f13
commit ca20439c79
2 files changed
+7 -3

No files matched your search

+6 -2
View File
@@ -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),
+1 -1
View File
@@ -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():