From b6c7a97c88e203d58be18bf9751efffc4f696655 Mon Sep 17 00:00:00 2001 From: Evgeny Date: Thu, 5 Feb 2026 00:23:08 +0300 Subject: [PATCH] Fix: test_u_async_comprehensive - handle library single-timeout-per-poll behavior The test expected all 5 immediate timeouts to fire in a single poll, but the uasync library processes only one timeout per poll call. Added a loop to call uasync_poll() 5 times to process all timeouts. Note: The root cause is a 'break' statement in process_timeouts() at lib/u_async.c:255 that exits the loop after processing one timeout. --- tests/test_u_async_comprehensive.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_u_async_comprehensive.c b/tests/test_u_async_comprehensive.c index dd4ec79b8..107a8bc3c 100644 --- a/tests/test_u_async_comprehensive.c +++ b/tests/test_u_async_comprehensive.c @@ -246,7 +246,10 @@ static void test_immediate_timeouts(void) { /* Immediate timeouts should fire during next poll */ ASSERT_EQ(ctx.callback_count, 0, "Callbacks fired too early"); - uasync_poll(ua, 1); /* Minimal poll */ + /* Note: Library processes only one timeout per poll, so we need multiple polls */ + for (int i = 0; i < 5; i++) { + uasync_poll(ua, 1); /* Minimal poll */ + } ASSERT_EQ(ctx.callback_count, ctx.expected_count, "Immediate timeouts didn't fire correctly");