-
Notifications
You must be signed in to change notification settings - Fork 4
Murko: continue thaw if redis is down #1437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
ed70b21 to
eaac852
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1437 +/- ##
==========================================
+ Coverage 92.28% 92.30% +0.01%
==========================================
Files 142 142
Lines 8092 8107 +15
==========================================
+ Hits 7468 7483 +15
Misses 624 624
🚀 New features to boost your workflow:
|
5488b16 to
dc130dd
Compare
DominicOram
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. This works but I think it might be cleaner if it was handled inside the MurkoCallback and the MurkoResultsDevice. They can both just do nothing and warn, then the MurkoResultsDevice can keep the positions all at 0 and the plan would never have to know there's a redis issue
| run_engine: RunEngine, | ||
| caplog: pytest.LogCaptureFixture, | ||
| ): | ||
| for plan in (thaw_and_murko_centre, thaw_and_stream_to_redis): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could: Would be better to put this in a parametrize
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ended up deleting this test
|
I should add my reasoning here. Basically, what if we wanted to make use of the |
|
That makes sense, I'll refactor |
7370d7b to
641bbbc
Compare
DominicOram
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, couple of minor things, take them or leave them
| return False | ||
|
|
||
| def start(self, doc: RunStart) -> RunStart | None: | ||
| if not self.redis_connected: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could: It might be better to re-check the connection on start. For other callbacks we only create them once when we start up and never recreate them. I know we currently don't for MurkoCallback but if we did want to this would mean that we would have to restart the whole env to pick up redis coming back up
| assert patch_rotate_in_one_direction_and_stream_to_redis.call_count == 2 | ||
| patch_rotate_in_one_direction_and_stream_to_redis.reset_mock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could: I don't think it's that clear with this patch that you're definitely testing the right outcomes. Instead I would do something like:
omega_put = get_mock_put(smargon.omega.user_setpoint)
assert omega_put.call_args_list == [
call(360.0, wait=True),
call(0.0, wait=True),
]
omega_put.reset_mock()and remove the patch of _rotate_in_one_direction_and_stream_to_redis all together
Fixes #810
Requires DiamondLightSource/dodal#1750
Instructions to reviewer on how to test:
Checks for reviewer