[LTP] [PATCH] syscalls/utime03: relax the check for 1 second difference
Jan Stancek
jstancek@redhat.com
Thu Feb 20 10:28:30 CET 2025
The test is using tst_get_fs_timestamp() which is using REALTIME_COARSE
clock, which is slightly less accurate. Back in 2022 we added extra log
message to print also min and max time. In those rare instances where
it fails this extra log shows it failed by one second difference.
Relax the check a little. Tested on aarch64 VMs, where it's usually
reproducible after couple hundred iterations.
Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
testcases/kernel/syscalls/utime/utime03.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testcases/kernel/syscalls/utime/utime03.c b/testcases/kernel/syscalls/utime/utime03.c
index 564e1de3dd77..abc2e6338af6 100644
--- a/testcases/kernel/syscalls/utime/utime03.c
+++ b/testcases/kernel/syscalls/utime/utime03.c
@@ -70,7 +70,7 @@ static void run(void)
SAFE_SETEUID(user_uid);
mintime = tst_get_fs_timestamp();
TST_EXP_PASS(utime(TEMP_FILE, NULL));
- maxtime = tst_get_fs_timestamp();
+ maxtime = tst_get_fs_timestamp() + 1;
SAFE_SETEUID(root_uid);
SAFE_STAT(TEMP_FILE, &statbuf);
--
2.43.0
More information about the ltp
mailing list