diff options
| author | Ha Thach <[email protected]> | 2024-01-24 13:13:02 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-01-24 13:13:02 +0700 |
| commit | 09ae91700c7441fe63726d08ebc126632436c92b (patch) | |
| tree | dd6adb9ff9ce132762ec8e2583325d50a0f2b743 /test | |
| parent | f92c2c2758e47c1dd9a0e441f1a48188171ae403 (diff) | |
| parent | 9d0df8ebc5f643ff0b3dd06da14d11b3c1107a21 (diff) | |
Merge pull request #2424 from hathach/retry-hil-s3
Retry hil s3
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 |
