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

View File

@@ -364,8 +364,14 @@ def main(config_file, board):
print(f' {test} ...', end='')
# flash firmware
# 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