preadv203: avoid false failures when runtime is scaled down
PATCH 1/1 preadv203: avoid false failures when runtime is scaled down
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
--- testcases/kernel/syscalls/preadv2/preadv203.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
testcases/kernel/syscalls/preadv2/preadv203.c +6 -1
@@ -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" ); }
Signature · 5 lines
2.49.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp