Skip to content

Commit

Permalink
We do want to count it as "stopped," actually.
Browse files Browse the repository at this point in the history
  • Loading branch information
SyntaxColoring committed Jun 25, 2024
1 parent cd2f81b commit 95cd5f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
10 changes: 1 addition & 9 deletions api/src/opentrons/protocol_engine/state/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,21 +382,13 @@ def handle_action(self, action: Action) -> None: # noqa: C901
if not self._state.run_result:
self._state.recovery_target_command_id = None

self._state.queue_status = QueueStatus.PAUSED
if action.from_estop:
self._state.stopped_by_estop = True
self._state.run_result = RunResult.FAILED
elif self._state.queue_status in (
QueueStatus.AWAITING_RECOVERY,
QueueStatus.AWAITING_RECOVERY_PAUSED,
):
# If someone aborts error recovery (by stopping the run), treat it
# as a run failure, not a normal run stop.
self._state.run_result = RunResult.FAILED
else:
self._state.run_result = RunResult.STOPPED

self._state.queue_status = QueueStatus.PAUSED

elif isinstance(action, FinishAction):
if not self._state.run_result:
self._state.queue_status = QueueStatus.PAUSED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ def test_final_state_after_stop() -> None:
def test_final_state_after_error_recovery_stop() -> None:
"""Test the final state of the run after it's stopped during error recovery.
Unlike a stop outside of error recovery, we count this as a run failure.
We still want to count this as "stopped," not "failed."
"""
subject = CommandStore(config=_make_config(), is_door_open=False)
subject_view = CommandView(subject.state)
Expand Down Expand Up @@ -799,6 +799,6 @@ def test_final_state_after_error_recovery_stop() -> None:
finish_error_details=None,
)
)
assert subject_view.get_status() == EngineStatus.FAILED
assert subject_view.get_status() == EngineStatus.STOPPED
assert subject_view.get_recovery_target() is None
assert subject_view.get_error() is None

0 comments on commit 95cd5f2

Please sign in to comment.