From bdbeaf97d6e0f36b27197c5e4800eca0bd437447 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Tue, 28 Mar 2017 14:16:53 +1100 Subject: [PATCH] freertos tests: Fix accidental "0 delay" in event group tests Was a slight race condition where tasks on other CPU may not have finished waking up on BIT_CALL when the unity task polled the event group state. --- components/freertos/test/test_freertos_eventgroups.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/freertos/test/test_freertos_eventgroups.c b/components/freertos/test/test_freertos_eventgroups.c index f32c20ade9..8d5a5fb326 100644 --- a/components/freertos/test/test_freertos_eventgroups.c +++ b/components/freertos/test/test_freertos_eventgroups.c @@ -52,14 +52,15 @@ TEST_CASE("FreeRTOS Event Groups", "[freertos]") } /* Tasks all start instantly, but this task will resume running at the same time as the higher priority tasks on the - other processor may still be setting up, so give a tick for them to also block on BIT_CALL... */ - vTaskDelay(1); + other processor may still be setting up, so allow time for them to also block on BIT_CALL... */ + vTaskDelay(10); for (int i = 0; i < COUNT; i++) { /* signal all tasks with "CALL" bit... */ xEventGroupSetBits(eg, BIT_CALL); - TEST_ASSERT_EQUAL_HEX16(ALL_RESPONSE_BITS, xEventGroupWaitBits(eg, ALL_RESPONSE_BITS, true, true, 100 / portMAX_DELAY)); + /* Only wait for 1 tick, the wakeup should be immediate... */ + TEST_ASSERT_EQUAL_HEX16(ALL_RESPONSE_BITS, xEventGroupWaitBits(eg, ALL_RESPONSE_BITS, true, true, 1)); } /* Ensure all tasks cleaned up correctly */