All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] epoll_wait04: Use tst_multiply_timeout()
@ 2026-09-28 15:30 Florian Schmaus via ltp
  2026-09-28 18:38 ` [LTP] " linuxtestproject.agent
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Florian Schmaus via ltp @ 2026-09-28 15:30 UTC (permalink / raw)
  To: ltp

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


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-10-05 13:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-28 15:30 [LTP] [PATCH] epoll_wait04: Use tst_multiply_timeout() Florian Schmaus via ltp
2026-09-28 18:38 ` [LTP] " linuxtestproject.agent
2026-10-05 13:16 ` [LTP] [PATCH] " Andrea Cervesato via ltp
2026-10-05 13:16 ` Andrea Cervesato via ltp

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.