retry flashih a few time due to random failed by s3

This commit is contained in:
hathach 2024-01-24 00:43:23 +07:00
parent 57bbf3ad2b
commit 82218c8d68
No known key found for this signature in database
GPG Key ID: F5D50C6D51D17CBA
1 changed files with 8 additions and 2 deletions

View File

@ -364,8 +364,14 @@ 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:
time.sleep(1)
assert ret.returncode == 0, 'Flash failed\n' + ret.stdout.decode()
# run test