From b87b58da579ee9d48cc03688d4eeffa3b3ad34ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20M=C3=BAdry?= Date: Mon, 24 Apr 2023 13:19:31 +0200 Subject: [PATCH] CI: fix sdcard examples timeout --- .../sdmmc/pytest_sdmmc_card_example.py | 31 ++++++++++--------- examples/storage/sd_card/sdmmc/sdkconfig.ci | 1 + .../sdspi/pytest_sdspi_card_example.py | 31 ++++++++++--------- examples/storage/sd_card/sdspi/sdkconfig.ci | 2 ++ 4 files changed, 37 insertions(+), 28 deletions(-) diff --git a/examples/storage/sd_card/sdmmc/pytest_sdmmc_card_example.py b/examples/storage/sd_card/sdmmc/pytest_sdmmc_card_example.py index 5eb2e3da3d..0a1685e873 100644 --- a/examples/storage/sd_card/sdmmc/pytest_sdmmc_card_example.py +++ b/examples/storage/sd_card/sdmmc/pytest_sdmmc_card_example.py @@ -26,18 +26,21 @@ def test_examples_sd_card_sdmmc(dut: Dut) -> None: logging.info('Card {} {} {}MHz {} found'.format(name, _type, speed, size)) - message_list = ('Opening file /sdcard/hello.txt', - 'File written', - 'Renaming file /sdcard/hello.txt to /sdcard/foo.txt', - 'Reading file /sdcard/foo.txt', - "Read from file: 'Hello {}!'".format(name), - re.compile(str.encode('Formatting card, allocation unit size=\\S+')), - 'file doesnt exist, format done', - 'Opening file /sdcard/nihao.txt', - 'File written', - 'Reading file /sdcard/nihao.txt', - "Read from file: 'Nihao {}!'".format(name), - 'Card unmounted') + message_list1 = ('Opening file /sdcard/hello.txt', + 'File written', + 'Renaming file /sdcard/hello.txt to /sdcard/foo.txt', + 'Reading file /sdcard/foo.txt', + "Read from file: 'Hello {}!'".format(name)) + sd_card_format = re.compile(str.encode('Formatting card, allocation unit size=\\S+')) + message_list2 = ('file doesnt exist, format done', + 'Opening file /sdcard/nihao.txt', + 'File written', + 'Reading file /sdcard/nihao.txt', + "Read from file: 'Nihao {}!'".format(name), + 'Card unmounted') - for msg in message_list: - dut.expect(msg, timeout=60) + for msg in message_list1: + dut.expect_exact(msg, timeout=30) + dut.expect(sd_card_format, timeout=180) # Provide enough time for SD card FATFS format operation + for msg in message_list2: + dut.expect_exact(msg, timeout=30) diff --git a/examples/storage/sd_card/sdmmc/sdkconfig.ci b/examples/storage/sd_card/sdmmc/sdkconfig.ci index 21cf9cd2a0..9bab0e01a2 100644 --- a/examples/storage/sd_card/sdmmc/sdkconfig.ci +++ b/examples/storage/sd_card/sdmmc/sdkconfig.ci @@ -1,2 +1,3 @@ CONFIG_EXAMPLE_FORMAT_IF_MOUNT_FAILED=y CONFIG_FATFS_VFS_FSTAT_BLKSIZE=4096 +CONFIG_ESP_TASK_WDT_EN=n diff --git a/examples/storage/sd_card/sdspi/pytest_sdspi_card_example.py b/examples/storage/sd_card/sdspi/pytest_sdspi_card_example.py index 9a735559f8..480aa9f2d6 100644 --- a/examples/storage/sd_card/sdspi/pytest_sdspi_card_example.py +++ b/examples/storage/sd_card/sdspi/pytest_sdspi_card_example.py @@ -28,18 +28,21 @@ def test_examples_sd_card_sdspi(dut: Dut) -> None: logging.info('Card {} {} {}MHz {} found'.format(name, _type, speed, size)) - message_list = ('Opening file /sdcard/hello.txt', - 'File written', - 'Renaming file /sdcard/hello.txt to /sdcard/foo.txt', - 'Reading file /sdcard/foo.txt', - "Read from file: 'Hello {}!'".format(name), - re.compile(str.encode('Formatting card, allocation unit size=\\S+')), - 'file doesnt exist, format done', - 'Opening file /sdcard/nihao.txt', - 'File written', - 'Reading file /sdcard/nihao.txt', - "Read from file: 'Nihao {}!'".format(name), - 'Card unmounted') + message_list1 = ('Opening file /sdcard/hello.txt', + 'File written', + 'Renaming file /sdcard/hello.txt to /sdcard/foo.txt', + 'Reading file /sdcard/foo.txt', + "Read from file: 'Hello {}!'".format(name)) + sd_card_format = re.compile(str.encode('Formatting card, allocation unit size=\\S+')) + message_list2 = ('file doesnt exist, format done', + 'Opening file /sdcard/nihao.txt', + 'File written', + 'Reading file /sdcard/nihao.txt', + "Read from file: 'Nihao {}!'".format(name), + 'Card unmounted') - for msg in message_list: - dut.expect(msg, timeout=20) + for msg in message_list1: + dut.expect_exact(msg, timeout=30) + dut.expect(sd_card_format, timeout=180) # Provide enough time for SD card FATFS format operation + for msg in message_list2: + dut.expect_exact(msg, timeout=30) diff --git a/examples/storage/sd_card/sdspi/sdkconfig.ci b/examples/storage/sd_card/sdspi/sdkconfig.ci index 7847e636ee..9bab0e01a2 100644 --- a/examples/storage/sd_card/sdspi/sdkconfig.ci +++ b/examples/storage/sd_card/sdspi/sdkconfig.ci @@ -1 +1,3 @@ CONFIG_EXAMPLE_FORMAT_IF_MOUNT_FAILED=y +CONFIG_FATFS_VFS_FSTAT_BLKSIZE=4096 +CONFIG_ESP_TASK_WDT_EN=n