fix(storage): mark storage pytest apps flaky in CI

This commit is contained in:
sonika.rathi
2026-07-21 09:49:05 +02:00
parent 8b166d2b7c
commit 0d9a7b87b3
4 changed files with 23 additions and 10 deletions

View File

@@ -8,6 +8,7 @@ from pytest_embedded import Dut
from pytest_embedded_idf.utils import idf_parametrize
@pytest.mark.flaky(reruns=2, reruns_delay=5)
@pytest.mark.emmc
@pytest.mark.parametrize(
'config',
@@ -32,14 +33,14 @@ def test_examples_sd_card_sdmmc(dut: Dut) -> None:
speed = dut.expect(re.compile(rb'Speed: (\S+)'), timeout=10).group(1).decode()
size = dut.expect(re.compile(rb'Size: (\S+)'), timeout=10).group(1).decode()
logging.info('Card {} {} {}MHz {} found'.format(name, _type, speed, size))
logging.info(f'Card {name} {_type} {speed}MHz {size} found')
message_list = (
'Opening file /eMMC/hello.txt',
'File written',
'Renaming file /eMMC/hello.txt to /eMMC/foo.txt',
'Reading file /eMMC/foo.txt',
"Read from file: 'Hello {}!'".format(name),
f"Read from file: 'Hello {name}!'",
'Card unmounted',
)

View File

@@ -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 re
@@ -7,18 +7,19 @@ from pytest_embedded import Dut
from pytest_embedded_idf.utils import idf_parametrize
@pytest.mark.flaky(reruns=2, reruns_delay=5)
@pytest.mark.generic
@idf_parametrize('target', ['esp32', 'esp32c3'], indirect=['target'])
def test_partition_find_example(dut: Dut) -> None:
def expect_partition(name: str, offset: int, size: int) -> None:
dut.expect(
re.compile(str.encode("found partition '{}' at offset {:#x} with size {:#x}".format(name, offset, size))),
re.compile(str.encode(f"found partition '{name}' at offset {offset:#x} with size {size:#x}")),
timeout=5,
)
def expect_find_partition(_type: str, subtype: str, label: str, name: str, offset: int, size: int) -> None:
dut.expect(
re.compile(str.encode('Find partition with type {}, subtype {}, label {}'.format(_type, subtype, label))),
re.compile(str.encode(f'Find partition with type {_type}, subtype {subtype}, label {label}')),
timeout=5,
)
expect_partition(name, offset, size)

View File

@@ -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 re
@@ -21,5 +21,15 @@ def test_examples_spiffs(dut: Dut) -> None:
rb'example: SPIFFS unmounted',
)
for msg in message_list:
dut.expect(re.compile(msg), timeout=60)
# Startup is fail-fast (Initializing SPIFFS appears quickly).
# First-boot format of ~960KB SPIFFS can exceed 120s on esp32c3 CI UART runners,
# so allow up to 240s for format/remount; remaining expects use 120s.
dut.expect(re.compile(message_list[0]), timeout=30)
spiffs_format = rb'SPIFFS: mount failed, -10025\. formatting\.\.\.'
format_or_partition = re.compile(rb'(?:' + spiffs_format + rb'|' + message_list[1] + rb')')
if dut.expect(format_or_partition, timeout=240) == 0:
dut.expect(re.compile(message_list[1]), timeout=240)
for msg in message_list[2:]:
dut.expect(re.compile(msg), timeout=120)