guard relativemove failures (#24835)
CI / AMD64 Build (push) Waiting to run
CI / AMD64 Smoke Test (push) Blocked by required conditions
CI / ARM Build (push) Waiting to run
CI / Jetson Jetpack 6 (push) Waiting to run
CI / AMD64 Extra Build (push) Blocked by required conditions
CI / ARM Extra Build (push) Blocked by required conditions
CI / Synaptics Build (push) Blocked by required conditions
CI / Assemble and push default build (push) Blocked by required conditions

This commit is contained in:
Josh Hawkins
2026-10-31 14:15:24 -06:00
committed by GitHub
parent 9b0aa75312
commit a0b8d40a66
2 changed files with 15 additions and 1 deletions
+6 -1
View File
@@ -625,7 +625,12 @@ class OnvifController:
move_request.Speed = move_speed
await cam["ptz"].RelativeMove(move_request)
try:
await cam["ptz"].RelativeMove(move_request)
except Exception as e:
logger.warning(
f"Onvif sending relative move request to {camera_name} failed: {e}"
)
# reset after the move request
move_request.Translation.PanTilt.x = 0
+9
View File
@@ -195,6 +195,15 @@ class TestManualRelativeMoveMetrics(unittest.IsolatedAsyncioTestCase):
)
)
async def test_failed_move_does_not_raise(self) -> None:
# an exception here ends the autotracker's move queue consumer for good
controller = _make_move_controller(autotracking_enabled=True)
controller.cams[CAMERA]["ptz"].RelativeMove.side_effect = TimeoutError
await controller._move_relative(CAMERA, 0.25, -0.25, 0, 1)
self.assertFalse(controller.cams[CAMERA]["active"])
async def test_metrics_written_when_autotracking_enabled(self) -> None:
# get_camera_status resets stop_time once the camera reports IDLE, so the
# autotracking path keeps its motion estimation timestamps