summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorYixingShen <[email protected]>2024-01-26 09:09:44 +0800
committerYixingShen <[email protected]>2024-01-26 09:09:44 +0800
commit2f2d2bcf3e1fd09fa15015efaae686dd65612c30 (patch)
tree45f89e794e57cdbd90b5851091c615ea16506195 /test
parent4c9f462423338a812378924233eac55ce0e96fb8 (diff)
parentb7134934363b88881e4767a16eecb22cad410d73 (diff)
Merge branch 'master' of https://github.com/YixingShen/tinyusb
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