fix(npoint): retry on wait_for_connection
CI for csaxs_bec / test (pull_request) Failing after 1m26s
CI for csaxs_bec / test (push) Failing after 1m27s

This commit is contained in:
x12sa
2026-05-13 16:06:19 +02:00
parent a4d8c570e1
commit 1c4165f301
+4 -15
View File
@@ -448,26 +448,15 @@ class NPointAxis(Device, PositionerBase):
self.high_limit_travel.put(limits[1])
def wait_for_connection(self, timeout: float = 30.0) -> bool:
self.controller.on(timeout=timeout)
self._update_setpoint_from_readback()
def _update_setpoint_from_readback(self):
"""
The setpoint is only stored locally. After a restart,
we need to update it to match the current readback value.
"""
for attempt in range(5):
try:
self.controller.on(timeout=timeout)
self.user_setpoint.setpoint = self.readback.get()
except Exception as e:
logger.warning(
f"NPointAxis {self.name}: Failed to update the setpoint from the readback value on attempt {attempt+1} during startup: {e}"
)
except TimeoutError:
self.controller.off(update_config=False)
time.sleep(1)
else:
logger.info(
f"NPointAxis {self.name}: Successfully updated the setpoint from the readback value on attempt {attempt+1} during startup."
)
break
else:
raise TimeoutError(