mirror of
https://github.com/espressif/esp-idf.git
synced 2026-05-28 16:46:31 +03:00
Merge branch 'bugfix/nvs-rw-value-pytest-idfci-4027' into 'master'
fix(examples): add flaky reruns to nvs_rw_value pytest for CI flash Closes IDFCI-4027, IDFCI-4463, and IDFCI-8653 See merge request espressif/esp-idf!48150
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user