From 3393115f0ea4d840b559e3a9bceea798caa789a6 Mon Sep 17 00:00:00 2001 From: "sonika.rathi" Date: Tue, 5 May 2026 18:38:37 +0200 Subject: [PATCH] fix(examples): add flaky reruns to nvs_rw_value pytest for CI flash --- examples/storage/nvs_rw_value/pytest_nvs_rw_value.py | 1 + .../storage/nvs_rw_value_cxx/pytest_nvs_rw_value_cxx.py | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/storage/nvs_rw_value/pytest_nvs_rw_value.py b/examples/storage/nvs_rw_value/pytest_nvs_rw_value.py index f6f2c862377..ddf68e3e52c 100644 --- a/examples/storage/nvs_rw_value/pytest_nvs_rw_value.py +++ b/examples/storage/nvs_rw_value/pytest_nvs_rw_value.py @@ -9,6 +9,7 @@ from pytest_embedded_idf.utils import idf_parametrize @pytest.mark.generic +@pytest.mark.flaky(reruns=2, reruns_delay=5) @idf_parametrize('target', ['esp32', 'esp32c3'], indirect=['target']) def test_examples_nvs_rw_value(dut: Dut) -> None: dut.serial.erase_flash() diff --git a/examples/storage/nvs_rw_value_cxx/pytest_nvs_rw_value_cxx.py b/examples/storage/nvs_rw_value_cxx/pytest_nvs_rw_value_cxx.py index 048fddc4530..ce763949bd1 100644 --- a/examples/storage/nvs_rw_value_cxx/pytest_nvs_rw_value_cxx.py +++ b/examples/storage/nvs_rw_value_cxx/pytest_nvs_rw_value_cxx.py @@ -9,15 +9,16 @@ from pytest_embedded_idf.utils import idf_parametrize @pytest.mark.generic +@pytest.mark.flaky(reruns=2, reruns_delay=5) @idf_parametrize('target', ['esp32', 'esp32c3'], indirect=['target']) def test_examples_nvs_rw_value_cxx(dut: Dut) -> None: dut.serial.erase_flash() dut.serial.flash() for i, counter_state in zip_longest(range(4), ('The value is not initialized yet!',), fillvalue='Done'): dut.expect('Opening Non-Volatile Storage \\(NVS\\) handle... Done', timeout=20) - dut.expect('Reading restart counter from NVS ... {}'.format(counter_state), timeout=20) - dut.expect('Restart counter = {}'.format(i) if int(i) > 0 else '', timeout=20) + dut.expect(f'Reading restart counter from NVS ... {counter_state}', timeout=20) + dut.expect(f'Restart counter = {i}' if int(i) > 0 else '', timeout=20) dut.expect('Updating restart counter in NVS ... Done', timeout=20) dut.expect('Committing updates in NVS ... Done', timeout=20) dut.expect('Restarting in 10 seconds...', timeout=20) - logging.info('loop {} has finished'.format(i)) + logging.info(f'loop {i} has finished')