Repository navigation
i15-1: fix robot spinner program race condition - #2229
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2229 +/- ##
=======================================
Coverage 99.30% 99.30%
=======================================
Files 378 378
Lines 14875 14876 +1
=======================================
+ Hits 14772 14773 +1
Misses 103 103 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
DominicOram
left a comment
There was a problem hiding this comment.
As discussed, we should instead try and do something like https://github.com/bluesky/ophyd-async/blob/f4e2cd8761af9d80d108ad04a69723306628a678/src/ophyd_async/core/_signal.py#L650 where we start the monitor on the program running first. However, the existing function only works for set, not trigger so I think we need to:
- Run a camonitor on the beamline to check that this is actually going high
- If it is add a
trigger_and_wait_for_valueintoophyd_async, probably using some shared code with the set and use it here - If it isn't it might be worth discussing with controls or we just do this?
|
I tested this out and the program is so quick that usually we don't get any change on the |
DominicOram
left a comment
There was a problem hiding this comment.
Great, thanks, a few comments to tidy up
| ProgramRunning.PROGRAM_RUNNING, | ||
| timeout=self.PROGRAM_STARTED_RUNNING_TIMEOUT, | ||
| ) | ||
| await wait_for_value( |
There was a problem hiding this comment.
Should: Its seems weird to wait for the program to finish in the case where we don't wait for the program to start.
| await self._trigger_program_and_wait_for_complete( | ||
| signal_to_set, wait_for_program_running=False | ||
| ) | ||
| await wait_for_value( |
There was a problem hiding this comment.
Could: Could: Given https://github.com/DiamondLightSource/dodal/pull/2229/changes#r4513019538 I think it might be better to just call await trigger here and keep _trigger_program_and_wait_for_complete as it was before?
| self.current_sample.position.set(0), | ||
| ) | ||
|
|
||
| async def _set_spinner_state(self, new_state: SpinnerState) -> None: |
There was a problem hiding this comment.
Could: Would be nice to have a test that this doesn't wait for the program
There was a problem hiding this comment.
I guess we could make it so the the mock behaviour is to not have the program running flag go high on stopping the spinner? But it's not a very obvious test
There was a problem hiding this comment.
Yeah I'll change the mock behaviour to not put the program running flag high when setting spinner state
| set_mock_value(robot.puck_sel, 0) # Set initial position | ||
| set_mock_value(robot.pos_sel, 0) # Set initial position | ||
|
|
||
| callback_on_mock_put( |
There was a problem hiding this comment.
Should: I think these would be better put in the MockRobot
Fixes DiamondLightSource/crystallography-bluesky#180
Instructions to reviewer on how to test:
Checks for reviewer
dodal connect ${BEAMLINE}