diff options
| author | Jerry Palacios <[email protected]> | 2024-02-07 17:03:13 -0600 |
|---|---|---|
| committer | Jerry Palacios <[email protected]> | 2024-02-07 17:03:13 -0600 |
| commit | 6c4a5292a6a59dec1b7f37be42725ea85205f3c9 (patch) | |
| tree | 774cb5a4fa024cc11ee32989fce90097744f0b9e /test | |
| parent | 17cd5e095255103696e1dde3c5dc7f06ef61274c (diff) | |
Back to original
Diffstat (limited to 'test')
| -rw-r--r-- | test/hil/hil_test.py | 11 |
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 |
