From 715ff1e432b19b07980730a38bec903233a7c84b Mon Sep 17 00:00:00 2001 From: Darian Leung Date: Tue, 11 Oct 2022 14:24:39 +0800 Subject: [PATCH] freertos: Fix vTaskSuspendAll unit test falkiness This commit fixes falkey unit tests (due to memory leaks) by adding a short delay at the end of the test to allow the idle task to free task memory. --- .../integration/tasks/test_vTaskSuspendAll_xTaskResumeAll.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/freertos/test/integration/tasks/test_vTaskSuspendAll_xTaskResumeAll.c b/components/freertos/test/integration/tasks/test_vTaskSuspendAll_xTaskResumeAll.c index 34d5d96d33..4ef4f081e4 100644 --- a/components/freertos/test/integration/tasks/test_vTaskSuspendAll_xTaskResumeAll.c +++ b/components/freertos/test/integration/tasks/test_vTaskSuspendAll_xTaskResumeAll.c @@ -229,6 +229,8 @@ TEST_CASE("Test vTaskSuspendAll() and xTaskResumeAll() multicore", "[freertos]") } vSemaphoreDelete(done_sem); + // Add a short delay to allow the idle task to free any remaining task memory + vTaskDelay(10); } #endif // !CONFIG_FREERTOS_UNICORE @@ -387,6 +389,8 @@ TEST_CASE("Test vTaskSuspendAll allows scheduling on other cores", "[freertos]") } vSemaphoreDelete(test_unblk_done_sem); + // Add a short delay to allow the idle task to free any remaining task memory + vTaskDelay(10); } #endif // !CONFIG_FREERTOS_UNICORE @@ -504,5 +508,7 @@ TEST_CASE("Test xTaskResumeAll resumes pended tasks", "[freertos]") ulTaskNotifyTake(pdTRUE, portMAX_DELAY); vTaskDelete(susp_tsk_hdl); } + // Add a short delay to allow the idle task to free any remaining task memory + vTaskDelay(10); } #endif // !CONFIG_FREERTOS_SMP