Skip to content

Commit e1b5538

Browse files
committed
tests: drivers: grtc: grtc_reset: set timeout
Handle possible hanging operations. Signed-off-by: Piotr Kosycarz <[email protected]>
1 parent 66ee3a6 commit e1b5538

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

tests/drivers/grtc/grtc_reset/pytest/tests.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ def reset_dut(dut: DeviceAdapter, reset_kind: str = "RESET_PIN"):
2323
"--serial-number",
2424
dut.device_config.id.lstrip("0"),
2525
]
26-
subprocess.check_output(cmd, stderr=subprocess.STDOUT)
26+
logger.info(" ".join(cmd))
27+
output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, timeout=5).decode("utf-8")
28+
logger.info(output)
2729

2830
def get_cycle_and_uptime_from_logs(dut: DeviceAdapter):
29-
lines = dut.readlines_until(num_of_lines=5)
31+
lines = dut.readlines_until(timeout=5)
3032
for line in lines:
3133
match_cycle = re.search(r'k_cycle_get_32\s*=\s*(\d+)', line)
3234
if match_cycle:

tests/drivers/grtc/grtc_reset/testcase.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ tests:
2020
harness_config:
2121
pytest_root:
2222
- "pytest/tests.py::test_grtc_reset"
23+
timeout: 30

0 commit comments

Comments
 (0)