You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Dodal connect on i22 is not actually connecting #864
If I run dodal connect i22 I get all of the beamline connected suspiciously quickly. It turns out that if I edit one of the PV prefixes in i22.pyto be incorrect then dodal connect i22 will still pass.
Acceptance Criteria
If I deliberately break one of the PV prefixes in i22.py then dodal connect i22 actually fails
This is different than 850: 850 is that when make_all_devices is called, any exceptions in the device_instantiation way of creating and connected devices are swallowed and do not cause test failures.
This is that make_all_devices doesn't ever call connect on the devices given from a @device_factory after they are made- make_all_devices may catch exceptions in instantiating the device and prevent it being an error, but not in the connect which is what's more useful...
The cause of this issue that dodal connect <beamline> does not attempt to connect the devices, but expects device_instantiation to do it, which is does as long as wait_for_connection=True is passed. In practice this is true often enough that no one has really noticed, but it is technically still a bug in main because dodal connect does not work for lazy devices. It is just made worse in the world of DeviceInitializationController because all devices are lazy by default there.
So the fix is to make sure the dodal CLI actually calls ensure_connected on the devices it connects to.
Activity
DominicOram commentedon Oct 24, 2024
@callumforrester and @DiamondJoseph am I right that this is different to #850?
DiamondJoseph commentedon Oct 25, 2024
This is different than 850: 850 is that when make_all_devices is called, any exceptions in the
device_instantiationway of creating and connected devices are swallowed and do not cause test failures.This is that make_all_devices doesn't ever call connect on the devices given from a
@device_factoryafter they are made- make_all_devices may catch exceptions in instantiating the device and prevent it being an error, but not in the connect which is what's more useful...callumforrester commentedon Oct 25, 2024
Additional acceptance criteria: If we could have a regression unit test that would be great
DominicOram commentedon Oct 28, 2024
With #869 reverted I don't believe this issue is on main now. However, we will need to address it before reinstating the device factory
callumforrester commentedon Nov 11, 2024
The cause of this issue that
dodal connect <beamline>does not attempt to connect the devices, but expectsdevice_instantiationto do it, which is does as long aswait_for_connection=Trueis passed. In practice this is true often enough that no one has really noticed, but it is technically still a bug in main becausedodal connectdoes not work for lazy devices. It is just made worse in the world ofDeviceInitializationControllerbecause all devices are lazy by default there.So the fix is to make sure the dodal CLI actually calls
ensure_connectedon the devices it connects to.