From 92a823cf89e6cc1050b31207766b1ba43df0f74f Mon Sep 17 00:00:00 2001 From: vegano1 Date: Wed, 27 Nov 2024 12:38:50 -0500 Subject: [PATCH] add serial.flush before sending command --- .../hardware_testing/modules/flex_stacker_evt_qc/driver.py | 1 + .../modules/flex_stacker_evt_qc/test_estop.py | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/hardware-testing/hardware_testing/modules/flex_stacker_evt_qc/driver.py b/hardware-testing/hardware_testing/modules/flex_stacker_evt_qc/driver.py index 791ba5ed566..11197aabafd 100644 --- a/hardware-testing/hardware_testing/modules/flex_stacker_evt_qc/driver.py +++ b/hardware-testing/hardware_testing/modules/flex_stacker_evt_qc/driver.py @@ -122,6 +122,7 @@ def __init__(self, port: str, simulating: bool = False) -> None: def _send_and_recv(self, msg: str, guard_ret: str = "") -> str: """Internal utility to send a command and receive the response.""" assert not self._simulating + self._serial.flush() self._serial.write(msg.encode()) ret = self._serial.readline() if guard_ret: diff --git a/hardware-testing/hardware_testing/modules/flex_stacker_evt_qc/test_estop.py b/hardware-testing/hardware_testing/modules/flex_stacker_evt_qc/test_estop.py index 4f698005504..2a2f24161b7 100644 --- a/hardware-testing/hardware_testing/modules/flex_stacker_evt_qc/test_estop.py +++ b/hardware-testing/hardware_testing/modules/flex_stacker_evt_qc/test_estop.py @@ -1,6 +1,6 @@ """Test E-Stop.""" -from time import sleep + from typing import List, Union from hardware_testing.data import ui from hardware_testing.data.csv_report import ( @@ -48,8 +48,6 @@ def run(driver: FlexStacker, report: CSVReport, section: str) -> None: ui.print_header("Trigger E-Stop") if not driver._simulating: ui.get_user_ready("Trigger the E-Stop") - # wait a bit before requesting e-stop state - sleep(2) if not driver.get_estop(): print("E-Stop is not triggered")