mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
Merge branch 'fix/freertos_delete_block_tasks_test_v5.1' into 'release/v5.1'
test(freertos): Added stability fixes to the delete blocked tasks test (v5.1) See merge request espressif/esp-idf!44489
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -130,7 +130,8 @@ TEST_CASE("FreeRTOS Delete Blocked Tasks", "[freertos]")
|
||||
|
||||
(1000 iterations takes about 9 seconds on ESP32 dual core)
|
||||
*/
|
||||
for(unsigned iter = 0; iter < 1000; iter++) {
|
||||
unsigned iter = 0;
|
||||
for (iter = 0; iter < 1000; iter++) {
|
||||
// Create everything
|
||||
SemaphoreHandle_t sem = xSemaphoreCreateMutex();
|
||||
for(unsigned i = 0; i < portNUM_PROCESSORS + 1; i++) {
|
||||
@@ -145,15 +146,25 @@ TEST_CASE("FreeRTOS Delete Blocked Tasks", "[freertos]")
|
||||
|
||||
vTaskDelay(5); // Let the tasks juggle the mutex for a bit
|
||||
|
||||
for(unsigned i = 0; i < portNUM_PROCESSORS + 1; i++) {
|
||||
for (unsigned i = 0; i < portNUM_PROCESSORS + 1; i++) {
|
||||
vTaskSuspend(blocking_tasks[i]);
|
||||
vTaskDelete(blocking_tasks[i]);
|
||||
params[i].deleted = true;
|
||||
}
|
||||
vTaskDelay(4); // Yield to the idle task for cleanup
|
||||
|
||||
// As an experiment, until IDFCI-4988 is fixed (CI runner loses connection to the target)
|
||||
// let's occasionally print a message to the console to ensure the test is running
|
||||
// and keep the console active.
|
||||
if (iter && iter % 100 == 0) {
|
||||
// In each iteration, we create portNUM_PROCESSORS + 1 tasks
|
||||
printf("Deleted %u blocked tasks\n", iter * (portNUM_PROCESSORS + 1));
|
||||
}
|
||||
|
||||
vSemaphoreDelete(sem);
|
||||
|
||||
// Check we haven't leaked resources yet
|
||||
TEST_ASSERT_GREATER_OR_EQUAL(before - 256, heap_caps_get_free_size(MALLOC_CAP_8BIT));
|
||||
}
|
||||
printf("Deleted %u blocked tasks\n", iter * (portNUM_PROCESSORS + 1));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user