syscalls: make atime-sensitive tests more robust by extending sleep to 1.5s
PATCH 1/1 syscalls: make atime-sensitive tests more robust by extending sleep to 1.5s
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
--- testcases/kernel/syscalls/lstat/lstat03.c | 2 +- testcases/kernel/syscalls/mount/mount03.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
testcases/kernel/syscalls/lstat/lstat03.c +1 -1
@@ -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 ); }
testcases/kernel/syscalls/mount/mount03.c +1 -1
@@ -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);
Signature · 5 lines
2.51.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi!
Signature · 5 lines
Cyril Hrubis [email protected] -- Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 3 lines · Cyril Hrubis
Hi!
Reviewed-by Cyril Hrubis <[email protected]>
Patch merged, thanks!
Signature · 5 lines
Regards, Li Wang -- Mailing list info: https://lists.linux.it/listinfo/ltp