From 134e14849b1864ce3454950a50d2c79d93a96cd8 Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 2 Apr 2026 23:30:06 +0700 Subject: fix hil host cdc echo test with imxrt and other fast mcu --- test/hil/hil_test.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/hil/hil_test.py b/test/hil/hil_test.py index cf3cff1a3..40779d1a4 100755 --- a/test/hil/hil_test.py +++ b/test/hil/hil_test.py @@ -564,7 +564,7 @@ def test_host_cdc_msc_hid(board): ser.flush() # wait until this chunk is echoed back echo = b'' - t_end = time.monotonic() + 5.0 + t_end = time.monotonic() + 1.0 while time.monotonic() < t_end and len(echo) < chunk_size: rd = ser.read(chunk_size - len(echo)) if rd: @@ -1189,7 +1189,7 @@ def test_example(board, f1, example): print(f'Flashing {fw_name}.elf') # flash firmware. It may fail randomly, retry a few times - max_rety = 3 + max_rety = max_retry start_s = time.time() for i in range(max_rety): ret = globals()[f'flash_{board["flasher"]["name"].lower()}'](board, fw_name) @@ -1269,6 +1269,7 @@ def main(): global verbose global test_only global build_dir + global max_retry duration = time.time() @@ -1278,6 +1279,7 @@ def main(): parser.add_argument('-s', '--skip', action='append', default=[], help='Skip boards from test') parser.add_argument('-t', '--test-only', action='append', default=[], help='Tests to run, all if not specified') parser.add_argument('-B', '--build', default='cmake-build', help='Build folder name (default: cmake-build)') + parser.add_argument('-r', '--retry', type=int, default=3, help='Retry count for failed tests (default: 3)') parser.add_argument('-v', '--verbose', action='store_true', help='Verbose output') args = parser.parse_args() @@ -1287,6 +1289,7 @@ def main(): verbose = args.verbose test_only = args.test_only build_dir = args.build + max_retry = args.retry # if config file is not found, try to find it in the same directory as this script if not os.path.exists(config_file): -- cgit v1.3.1