[LTP] [PATCH] preadv203: avoid false failures when runtime is scaled down

Li Wang liwang@redhat.com
Fri Jun 20 10:55:48 CEST 2025


This test relies on a certain number of iterations of I/O operations to
probabilistically trigger EAGAIN, which is a core part of the test's pass
condition.

When .runtime is scaled down with LTP_RUNTIME_MUL=0.1, the main test loop
(while (!stop && tst_remaining_runtime())) exits too early, before enough
contention or conditions are created to hit EAGAIN, especially on fast
filesystems (e.g., ext2, ext4).

This leads to false negatives like:
  preadv203.c:224: TFAIL: Haven't got EAGAIN

To address this, we now report TCONF (configuration issue) when the test
finishes without EAGAIN but also before the expected runtime could be met.
This avoids misreporting test failures due to overly aggressive runtime scaling.

Rely-on: https://lists.linux.it/pipermail/ltp/2025-June/043960.html
Signed-off-by: Li Wang <liwang@redhat.com>
---
 testcases/kernel/syscalls/preadv2/preadv203.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/preadv2/preadv203.c b/testcases/kernel/syscalls/preadv2/preadv203.c
index 72a35d3ab..128e7ae34 100644
--- a/testcases/kernel/syscalls/preadv2/preadv203.c
+++ b/testcases/kernel/syscalls/preadv2/preadv203.c
@@ -218,8 +218,13 @@ static void verify_preadv2(void)
 	SAFE_PTHREAD_JOIN(dropper, NULL);
 	SAFE_PTHREAD_JOIN(writer, NULL);
 
-	if (eagains)
+	if (eagains) {
 		tst_res(TPASS, "Got some EAGAIN");
+		return;
+	}
+
+	if (!tst_remaining_runtime())
+		tst_res(TCONF, "Runtime too short to reliably trigger EAGAIN");
 	else
 		tst_res(TFAIL, "Haven't got EAGAIN");
 }
-- 
2.49.0



More information about the ltp mailing list