-
Notifications
You must be signed in to change notification settings - Fork 11
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
Wait for scan status to change in the PMAC ProgramRunner #773
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #773 +/- ##
==========================================
+ Coverage 94.89% 94.90% +0.01%
==========================================
Files 115 115
Lines 4641 4654 +13
==========================================
+ Hits 4404 4417 +13
Misses 237 237 ☔ View full report in Codecov by Sentry. |
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.
Great, thanks, one comment
await wait_for_value( | ||
self.status, | ||
ScanState.RUNNING, | ||
timeout=DEFAULT_TIMEOUT, | ||
) | ||
await wait_for_value(self.status, ScanState.DONE, timeout) |
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.
Should: The timeout is now wrong. At it's worst this function as a whole won't timeout until DEFAULT_TIMEOUT
+ timeout
. You can fix this by putting them in their own asyncio.wait_for
, see for example the BartRobot
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.
Added a comment explaining the timeout. In short, the name is misleading but forced by the signature of set
. The second timeout should be the total time the scan should take so that it doesn't timeout while the motion program is still running. The first one is just a check that the scan actually starts so it doesn't need to be as long.
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.
Great, thanks. We should probably use kickoff and complete, I have made #788
Fixes #771
Also adds a command to abort a program.
Instructions to reviewer on how to test: