Linux Test Project
 help / color / mirror / Atom feed
* [LTP] [PATCH] syscalls/utime03: relax the check for 1 second difference
@ 2025-02-20  9:28 Jan Stancek
  2025-02-20 10:51 ` Petr Vorel
  2025-02-20 11:17 ` Cyril Hrubis
  0 siblings, 2 replies; 11+ messages in thread
From: Jan Stancek @ 2025-02-20  9:28 UTC (permalink / raw)
  To: ltp; +Cc: liwan

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


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-02-28 12:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-20  9:28 [LTP] [PATCH] syscalls/utime03: relax the check for 1 second difference Jan Stancek
2025-02-20 10:51 ` Petr Vorel
2025-02-20 11:17 ` Cyril Hrubis
2025-02-20 13:44   ` Jan Stancek
2025-02-21  8:24     ` Jan Stancek
2025-02-24 11:24       ` [LTP] [PATCH v2] syscalls/utime03: use realtime clock for upper bound check Jan Stancek
2025-02-24 15:41         ` Cyril Hrubis
2025-02-24 16:06           ` Jan Stancek
2025-02-25 11:39           ` [LTP] [PATCH v3] provide separate functions for getting start and end fs timestamps Jan Stancek
2025-02-25 13:18             ` Cyril Hrubis
2025-02-28 12:22               ` Jan Stancek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox