summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorIngHK <[email protected]>2024-02-07 10:11:42 +0100
committerIngHK <[email protected]>2024-02-07 10:11:42 +0100
commita0660027311738947a4227df63767fc81328dc86 (patch)
tree8e04c514619a9975999dd68892b247df2cf0759c /test
parente784e20b93068f4b063e066eb50ea005aeec99f4 (diff)
parentb60d0ff1d4f1db0e3caeb26895e73e749206023a (diff)
Merge remote-tracking branch 'remotes/hathach/master' into improve_debug_prints
Diffstat (limited to 'test')
-rw-r--r--test/hil/hil_test.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/test/hil/hil_test.py b/test/hil/hil_test.py
index 7c662aeea..7f03ce43f 100644
--- a/test/hil/hil_test.py
+++ b/test/hil/hil_test.py
@@ -364,8 +364,15 @@ def main(config_file, board):
print(f' {test} ...', end='')
- # flash firmware
- ret = globals()[f'flash_{flasher}'](item, fw)
+ # flash firmware. It may fail randomly, retry a few times
+ for i in range(3):
+ ret = globals()[f'flash_{flasher}'](item, fw)
+ if ret.returncode == 0:
+ break
+ else:
+ print(f'Flashing failed, retry {i+1}')
+ time.sleep(1)
+
assert ret.returncode == 0, 'Flash failed\n' + ret.stdout.decode()
# run test