diff --git a/examples/storage/nvs/nvs_rw_value/pytest_nvs_rw_value.py b/examples/storage/nvs/nvs_rw_value/pytest_nvs_rw_value.py index 8bf6b6cac97..dd4bc5ce28d 100644 --- a/examples/storage/nvs/nvs_rw_value/pytest_nvs_rw_value.py +++ b/examples/storage/nvs/nvs_rw_value/pytest_nvs_rw_value.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: Unlicense OR CC0-1.0 import pytest from pytest_embedded import Dut @@ -6,6 +6,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/nvs_rw_value_cxx/pytest_nvs_rw_value_cxx.py b/examples/storage/nvs/nvs_rw_value_cxx/pytest_nvs_rw_value_cxx.py index 20e301b38f5..ce763949bd1 100644 --- a/examples/storage/nvs/nvs_rw_value_cxx/pytest_nvs_rw_value_cxx.py +++ b/examples/storage/nvs/nvs_rw_value_cxx/pytest_nvs_rw_value_cxx.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: Unlicense OR CC0-1.0 import logging from itertools import zip_longest @@ -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')