* [LTP] [PATCH] syscalls: make atime-sensitive tests more robust by extending sleep to 1.5s
@ 2025-11-10 10:10 Li Wang via ltp
2025-11-10 10:45 ` Cyril Hrubis
0 siblings, 1 reply; 3+ messages in thread
From: Li Wang via ltp @ 2025-11-10 10:10 UTC (permalink / raw)
To: ltp
These two atime-sensitive tests can still occasionally (< 0.1% probability) fail
on fast or virtualized environments (e.g. tmpfs, containers, high load) because
the comparison relies on second-level st_atime and the two accesses can land
within the same wall-clock second despite a 1.001s delay.
Increase the sleep window from ~1.001s to 1.5s in the following tests to reduce
false negatives caused by second-boundary races and scheduler jitter:
=== error logs ===
mount03.c:140: TFAIL: st.st_atime(1750804951) < atime(1750804951)
lstat03.c:38: TFAIL: Expect: file_stat->st_atime != symb_stat->st_atime
lstat03.c:39: TFAIL: Expect: file_stat->st_mtime != symb_stat->st_mtime
lstat03.c:40: TFAIL: Expect: file_stat->st_ctime != symb_stat->st_ctime
Fixes: ff60156bc02f ("mount03: flip to the next second before doing the access")
Signed-off-by: Li Wang <liwang@redhat.com>
---
testcases/kernel/syscalls/lstat/lstat03.c | 2 +-
testcases/kernel/syscalls/mount/mount03.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/testcases/kernel/syscalls/lstat/lstat03.c b/testcases/kernel/syscalls/lstat/lstat03.c
index a0ff4dc9b..9438e2920 100644
--- a/testcases/kernel/syscalls/lstat/lstat03.c
+++ b/testcases/kernel/syscalls/lstat/lstat03.c
@@ -70,7 +70,7 @@ static void setup(void)
SAFE_CLOSE(fd);
/* change st_atime / st_mtime / st_ctime */
- usleep(1001000);
+ usleep(1500000);
SAFE_SYMLINK(FILENAME, SYMBNAME);
}
diff --git a/testcases/kernel/syscalls/mount/mount03.c b/testcases/kernel/syscalls/mount/mount03.c
index 98be3dc0a..8dd6f3eed 100644
--- a/testcases/kernel/syscalls/mount/mount03.c
+++ b/testcases/kernel/syscalls/mount/mount03.c
@@ -120,7 +120,7 @@ static void test_file_dir_noatime(int update_fatime, int update_datime)
SAFE_CLOSEDIR(test_dir);
dir_atime = dir_st.st_atime;
- usleep(1001000);
+ usleep(1500000);
SAFE_READ(0, otfd, readbuf, sizeof(readbuf));
SAFE_FSTAT(otfd, &st);
--
2.51.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [LTP] [PATCH] syscalls: make atime-sensitive tests more robust by extending sleep to 1.5s
2025-11-10 10:10 [LTP] [PATCH] syscalls: make atime-sensitive tests more robust by extending sleep to 1.5s Li Wang via ltp
@ 2025-11-10 10:45 ` Cyril Hrubis
2025-11-11 2:52 ` Li Wang via ltp
0 siblings, 1 reply; 3+ messages in thread
From: Cyril Hrubis @ 2025-11-10 10:45 UTC (permalink / raw)
To: Li Wang; +Cc: ltp
Hi!
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [LTP] [PATCH] syscalls: make atime-sensitive tests more robust by extending sleep to 1.5s
2025-11-10 10:45 ` Cyril Hrubis
@ 2025-11-11 2:52 ` Li Wang via ltp
0 siblings, 0 replies; 3+ messages in thread
From: Li Wang via ltp @ 2025-11-11 2:52 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
On Mon, Nov 10, 2025 at 6:45 PM Cyril Hrubis <chrubis@suse.cz> wrote:
> Hi!
> Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
>
Patch merged, thanks!
--
Regards,
Li Wang
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-11-11 2:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-10 10:10 [LTP] [PATCH] syscalls: make atime-sensitive tests more robust by extending sleep to 1.5s Li Wang via ltp
2025-11-10 10:45 ` Cyril Hrubis
2025-11-11 2:52 ` Li Wang 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.