Skip to content

Commit 1d69d5f

Browse files
authored
Try to make utime.c test more robust (#676)
I saw this fail spuriously on CI, so this is an attempt to make that happen less...
1 parent 080a712 commit 1d69d5f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/src/utime.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ void run(int (*set_times)(int, const struct timespec[2]))
5757
TESTVAL(st.st_mtim.tv_sec,==,0);
5858
TESTVAL(st.st_mtim.tv_nsec,==,0);
5959

60-
t = time(0);
60+
// Allow for some slop and clock drift.
61+
t = time(0) - 5;
6162

6263
TEST(set_times(fd, ((struct timespec[2]){{.tv_nsec=UTIME_NOW},{.tv_nsec=UTIME_OMIT}})) == 0, "\n");
6364
TEST(fstat(fd, &st) == 0, "\n");

0 commit comments

Comments
 (0)