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

refactor(protocol-engine): Keep track of failed commands' error recovery types #14795

Merged

Conversation

SyntaxColoring
Copy link
Contributor

Overview

This goes towards (but does not close) EXEC-346.

Test Plan

We're sufficiently covered by automated tests.

Changelog

  • When a command fails, and we choose its recovery type (WAIT_FOR_RECOVERY or FAIL_RUN), store that recovery type for later retrieval.

    We need this for EXEC-346 because when the Python protocol thread sees a failed Protocol Engine command, something needs to tell it whether to raise an exception to immediately fail the run, or wait until an HTTP client issues a resume-from-recovery action.

    That's not done in this PR. It will probably happen in feat(api): Pause when pick_up_tip() errors in a Python protocol #14753.

  • As discussed a number of times on the RSS team: Deprecate the old unit testing style of testing CommandView and CommandStore independently. Instead, test them together. We already do this for TipView and TipStore.

    New tests should be added to the new file test_command_state.py. The old test files have been renamed to *old.py but are otherwise left in-place. We should gradually shift things to the new style as we continue to work in this area.

Review requests

None in particular.

Risk assessment

Low.

@SyntaxColoring SyntaxColoring requested a review from a team as a code owner April 3, 2024 22:05
@SyntaxColoring SyntaxColoring requested review from TamarZanzouri and a team April 3, 2024 22:05
Copy link

codecov bot commented Apr 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.24%. Comparing base (3b3c8e4) to head (d30b577).
Report is 3 commits behind head on edge.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             edge   #14795   +/-   ##
=======================================
  Coverage   67.24%   67.24%           
=======================================
  Files        2495     2495           
  Lines       71325    71325           
  Branches     8961     8961           
=======================================
  Hits        47959    47959           
  Misses      21254    21254           
  Partials     2112     2112           
Flag Coverage Δ
g-code-testing 92.43% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...pi/src/opentrons/protocol_engine/state/commands.py 99.18% <ø> (ø)

Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense!

@SyntaxColoring SyntaxColoring merged commit f95af4f into edge Apr 4, 2024
28 checks passed
@SyntaxColoring SyntaxColoring deleted the keep_track_of_command_error_recovery_strategies branch April 4, 2024 16:17
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.

2 participants