[LTP] [PATCH] epoll_wait04: Use tst_multiply_timeout()

Florian Schmaus florian.schmaus@codasip.com
Mon Sep 28 17:30:58 CEST 2026


On slow or emulated systems, epoll_wait04 can produce false positives
like:

epoll_wait04.c:36: TFAIL: epoll_wait() waited for 1106us with a timeout equal to zero

Avoid this by scaling the scheduling delay threshold with
tst_multiply_timeout(), which respects LTP_TIMEOUT_MUL and slow kernel
configurations.

Signed-off-by: Florian Schmaus <florian.schmaus@codasip.com>
---
 testcases/kernel/syscalls/epoll_wait/epoll_wait04.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/epoll_wait/epoll_wait04.c b/testcases/kernel/syscalls/epoll_wait/epoll_wait04.c
index 5c4a545471b2..74af77a6fb19 100644
--- a/testcases/kernel/syscalls/epoll_wait/epoll_wait04.c
+++ b/testcases/kernel/syscalls/epoll_wait/epoll_wait04.c
@@ -29,7 +29,7 @@ static void run(void)
 	if (TST_RET != 0)
 		tst_res(TFAIL | TTERRNO, "epoll_wait() returned %li", TST_RET);
 
-	if (tst_timer_elapsed_us() <= USEC_PRECISION)
+	if (tst_timer_elapsed_us() <= tst_multiply_timeout(USEC_PRECISION))
 		tst_res(TPASS, "epoll_wait() returns immediately with a timeout equal to zero");
 	else
 		tst_res(TFAIL, "epoll_wait() waited for %llius with a timeout equal to zero",
-- 
2.55.0



More information about the ltp mailing list