From c8580301e31788a4bd2a562acbaabccc61ad04c7 Mon Sep 17 00:00:00 2001 From: Fabrice DJIATSA Date: Tue, 3 Dec 2024 11:19:46 +0100 Subject: [PATCH] tests: drivers: uart: uart_async_api: fix error on test_write_abort With the changes made in PR #76061, only on the F429ZI platform, in the test_write_abort test,the number of received data (2) is not equal to the number of sent data (1). It looks like uart_tx_abort is done very quickly, and the callback doesn't have enough time to deal with it. Adding a small delay solves the problem and doesn't affect results on other platforms. Signed-off-by: Fabrice DJIATSA --- tests/drivers/uart/uart_async_api/src/test_uart_async.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/drivers/uart/uart_async_api/src/test_uart_async.c b/tests/drivers/uart/uart_async_api/src/test_uart_async.c index c087878eee88..dd87afbdd153 100644 --- a/tests/drivers/uart/uart_async_api/src/test_uart_async.c +++ b/tests/drivers/uart/uart_async_api/src/test_uart_async.c @@ -712,6 +712,7 @@ ZTEST_USER(uart_async_write_abort, test_write_abort) if (sent != 0) { zassert_equal(k_sem_take(&rx_rdy, K_MSEC(100)), 0, "RX_RDY timeout"); + k_sleep(K_MSEC(30)); zassert_equal(sent, received, "Sent is not equal to received."); } uart_rx_disable(uart_dev);