Skip to content
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

Merged
merged 12 commits into from
Sep 13, 2024

Conversation

noemifrisina
Copy link
Collaborator

@noemifrisina noemifrisina commented Sep 4, 2024

Fixes #771

Also adds a command to abort a program.

Instructions to reviewer on how to test:

  1. Run tests

Copy link

codecov bot commented Sep 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.90%. Comparing base (739f637) to head (dadbe02).
Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@DominicOram DominicOram left a 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

Comment on lines +148 to 153
await wait_for_value(
self.status,
ScanState.RUNNING,
timeout=DEFAULT_TIMEOUT,
)
await wait_for_value(self.status, ScanState.DONE, timeout)
Copy link
Contributor

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

Copy link
Collaborator Author

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.

Copy link
Contributor

@DominicOram DominicOram left a 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

@DominicOram DominicOram merged commit 212141f into main Sep 13, 2024
18 checks passed
@DominicOram DominicOram deleted the 771_pmac-wait-for-status branch September 13, 2024 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PMAC ProgramRunner should first wait for status to change
2 participants