fix(eiger): Fix on_complete from eiger to respect message_severity of JFJ broker status
CI for csaxs_bec / test (push) Failing after 1m24s
CI for csaxs_bec / test (pull_request) Failing after 1m28s

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-05-05 19:36:09 +02:00
co-authored by Copilot
parent d9e6fd1a9b
commit 46a8c9fcec
+17 -2
View File
@@ -354,7 +354,20 @@ class Eiger(PSIDeviceBase):
timeout = self._wait_for_on_complete
while time.time() - start_time < timeout:
if self.jfj_client.wait_for_idle(timeout=1, raise_on_timeout=False):
# TODO: Once available, add check for
# Call API endpoints to get broker status
broker_status = self.jfj_client.jfj_status
if broker_status.message_severity not in [
"success",
"info",
]: # Log if not success or info
logger.info(
f"JungfrauJoch broker status: {yaml.dump(broker_status.to_dict(), indent=4)}"
)
if broker_status.message_severity == "error": # Raise on error
raise EigerError(
f"Device {self.name} acquisition completed with error status from JungfrauJoch broker: {yaml.dump(broker_status.to_dict(), indent=4)}"
)
# Call API endpoint to get statistics
statistics: MeasurementStatistics = (
self.jfj_client.api.statistics_data_collection_get(_request_timeout=5)
)
@@ -363,8 +376,10 @@ class Eiger(PSIDeviceBase):
f"Device {self.name} acquisition incomplete. "
f"Expected {self._num_triggers} triggers, "
f"but only {statistics.images_collected} were collected."
f"\n\nBroker status: \n{yaml.dump(broker_status.to_dict(), indent=4)} \n\n"
f"Measurement statistics: \n{yaml.dump(statistics.to_dict(), indent=4)}"
)
return
return # Acquisition completed successfully, if none of the above conditions were met
logger.info(
f"Waiting for device {self.name} to finish complete, time elapsed: "
f"{time.time() - start_time}."