diff --git a/components/freertos/test_apps/freertos/misc/test_idf_additions.c b/components/freertos/test_apps/freertos/misc/test_idf_additions.c index 99e67eb97b..d9fc67adb7 100644 --- a/components/freertos/test_apps/freertos/misc/test_idf_additions.c +++ b/components/freertos/test_apps/freertos/misc/test_idf_additions.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2023-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -103,7 +103,6 @@ TEST_CASE("IDF additions: Task creation with SPIRAM memory caps and self deletio for (int i = 0; i < TEST_NUM_TASKS; i++) { // Create a task with caps TEST_ASSERT_EQUAL(pdPASS, xTaskCreateWithCaps(task_with_caps_self_delete, "task", 4096, NULL, UNITY_FREERTOS_PRIORITY, &task_handle[i], MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT)); - TEST_ASSERT_NOT_EQUAL(NULL, task_handle); // Get the task's memory TEST_ASSERT_EQUAL(pdTRUE, xTaskGetStaticBuffers(task_handle[i], &puxStackBuffer, &pxTaskBuffer)); } @@ -112,7 +111,11 @@ TEST_CASE("IDF additions: Task creation with SPIRAM memory caps and self deletio // Notify the task to delete itself xTaskNotifyGive(task_handle[i]); } + // Let the scheduler run the self-delete tasks. + vTaskDelay(1); } + // Allow the last batch to be freed by the cleanup task in vTaskDeleteWithCaps(). + vTaskDelay(50); } #endif /* CONFIG_FREERTOS_TASK_CREATE_ALLOW_EXT_MEM */