From e21105ca8c802946d664c0673a98cd6b3c57abeb 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 6d918b130a9..872bdf5c034 100644 --- a/examples/storage/nvs_rw_value/pytest_nvs_rw_value.py +++ b/examples/storage/nvs_rw_value/pytest_nvs_rw_value.py @@ -10,6 +10,7 @@ from pytest_embedded import Dut @pytest.mark.esp32 @pytest.mark.esp32c3 @pytest.mark.generic +@pytest.mark.flaky(reruns=2, reruns_delay=5) def test_examples_nvs_rw_value(dut: Dut) -> None: dut.serial.erase_flash() dut.serial.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 1666d62c4df..51ddf596766 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 @@ -10,14 +10,15 @@ from pytest_embedded import Dut @pytest.mark.esp32 @pytest.mark.esp32c3 @pytest.mark.generic +@pytest.mark.flaky(reruns=2, reruns_delay=5) 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')