Skip to content

Commit 82218c8

Browse files
committed
retry flashih a few time due to random failed by s3
1 parent 57bbf3a commit 82218c8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/hil/hil_test.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,14 @@ def main(config_file, board):
364364

365365
print(f' {test} ...', end='')
366366

367-
# flash firmware
368-
ret = globals()[f'flash_{flasher}'](item, fw)
367+
# flash firmware. It may fail randomly, retry a few times
368+
for i in range(3):
369+
ret = globals()[f'flash_{flasher}'](item, fw)
370+
if ret.returncode == 0:
371+
break
372+
else:
373+
time.sleep(1)
374+
369375
assert ret.returncode == 0, 'Flash failed\n' + ret.stdout.decode()
370376

371377
# run test

0 commit comments

Comments
 (0)