On Wed, Mar 15, 2023 at 1:31 PM Shijith Thotton <sthot...@marvell.com> wrote: > > Replaced sleep with a function to dequeue timer expiry events until > either the expected number of events have been dequeued or the specified > time has elapsed. This change closely esembles the behavior of the > tested systems. > > Signed-off-by: Shijith Thotton <sthot...@marvell.com>
> -#define MAX_TRIES num_evtims > - int sum = 0; > - int tries = 0; > - bool done = false; > - while (!done) { > - sum += rte_event_dequeue_burst(evdev, TEST_PORT_ID, evs, > - RTE_DIM(evs), 10); > - if (sum >= num_evtims || ++tries >= MAX_TRIES) > - done = true; > - > - rte_delay_ms(10); Please change git comments as Fix and add Fixes: tag as it it removing non deterministic sleep based approach for verification. > - } > - > - TEST_ASSERT_EQUAL(sum, num_evtims, "Expected %d timer expiry events, " > - "got %d", num_evtims, sum); > - > - TEST_ASSERT(tries < MAX_TRIES, "Exceeded max tries"); > - > - rte_delay_ms(100); > + n = timeout_event_dequeue(evs, RTE_DIM(evs), WAIT_TICKS(ticks)); > + TEST_ASSERT_EQUAL(n, num_evtims, "Expected %d timer expiry events, > got %d", > + num_evtims, n);